Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( true == apply_filters( 'is_gdpr', true ) ) {
- add_filter( 'pre_comment_user_ip', function( $ip ) {
- $packed_in_addr = inet_pton( $ip );
- if ( 4 == strlen( $packed_in_addr ) ) {
- return inet_ntop( inet_pton( $ip ) & inet_pton( '255.255.0.0' ) );
- } else {
- return inet_ntop( inet_pton( $ip ) & inet_pton( 'ffff:ffff:ffff:ffff:0000:0000:0000:0000' ) );
- }
- } );
- }
Add Comment
Please, Sign In to add comment