Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/contact-.../modules
File: disallowed-list.php
<?php
[0] Fix | Delete
[1] Fix | Delete
add_filter( 'wpcf7_spam', 'wpcf7_disallowed_list', 10, 2 );
[2] Fix | Delete
[3] Fix | Delete
function wpcf7_disallowed_list( $spam, $submission ) {
[4] Fix | Delete
if ( $spam ) {
[5] Fix | Delete
return $spam;
[6] Fix | Delete
}
[7] Fix | Delete
[8] Fix | Delete
$target = wpcf7_array_flatten( $submission->get_posted_data() );
[9] Fix | Delete
$target[] = $submission->get_meta( 'remote_ip' );
[10] Fix | Delete
$target[] = $submission->get_meta( 'user_agent' );
[11] Fix | Delete
$target = implode( "\n", $target );
[12] Fix | Delete
[13] Fix | Delete
$word = wpcf7_check_disallowed_list( $target );
[14] Fix | Delete
[15] Fix | Delete
$word = wpcf7_apply_filters_deprecated(
[16] Fix | Delete
'wpcf7_submission_is_blacklisted',
[17] Fix | Delete
array( $word, $submission ),
[18] Fix | Delete
'5.3',
[19] Fix | Delete
'wpcf7_submission_has_disallowed_words'
[20] Fix | Delete
);
[21] Fix | Delete
[22] Fix | Delete
$word = apply_filters(
[23] Fix | Delete
'wpcf7_submission_has_disallowed_words',
[24] Fix | Delete
$word,
[25] Fix | Delete
$submission
[26] Fix | Delete
);
[27] Fix | Delete
[28] Fix | Delete
if ( $word ) {
[29] Fix | Delete
if ( is_bool( $word ) ) {
[30] Fix | Delete
$reason = __( "Disallowed words are used.", 'contact-form-7' );
[31] Fix | Delete
} else {
[32] Fix | Delete
$reason = sprintf(
[33] Fix | Delete
__( "Disallowed words (%s) are used.", 'contact-form-7' ),
[34] Fix | Delete
implode( ', ', (array) $word )
[35] Fix | Delete
);
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
$submission->add_spam_log( array(
[39] Fix | Delete
'agent' => 'disallowed_list',
[40] Fix | Delete
'reason' => $reason,
[41] Fix | Delete
) );
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
$spam = (bool) $word;
[45] Fix | Delete
[46] Fix | Delete
return $spam;
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
function wpcf7_check_disallowed_list( $target ) {
[50] Fix | Delete
$mod_keys = get_option( 'disallowed_keys' );
[51] Fix | Delete
[52] Fix | Delete
if ( is_scalar( $mod_keys ) ) {
[53] Fix | Delete
$mod_keys = trim( $mod_keys );
[54] Fix | Delete
} else {
[55] Fix | Delete
$mod_keys = '';
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
if ( '' === $mod_keys ) {
[59] Fix | Delete
return false;
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
foreach ( explode( "\n", $mod_keys ) as $word ) {
[63] Fix | Delete
$word = trim( $word );
[64] Fix | Delete
$length = strlen( $word );
[65] Fix | Delete
[66] Fix | Delete
if ( $length < 2 or 256 < $length ) {
[67] Fix | Delete
continue;
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
$pattern = sprintf( '#%s#i', preg_quote( $word, '#' ) );
[71] Fix | Delete
[72] Fix | Delete
if ( preg_match( $pattern, $target ) ) {
[73] Fix | Delete
return $word;
[74] Fix | Delete
}
[75] Fix | Delete
}
[76] Fix | Delete
[77] Fix | Delete
return false;
[78] Fix | Delete
}
[79] Fix | Delete
[80] Fix | Delete
function wpcf7_blacklist_check( $target ) {
[81] Fix | Delete
wpcf7_deprecated_function(
[82] Fix | Delete
__FUNCTION__,
[83] Fix | Delete
'5.3',
[84] Fix | Delete
'wpcf7_check_disallowed_list'
[85] Fix | Delete
);
[86] Fix | Delete
[87] Fix | Delete
return wpcf7_check_disallowed_list( $target );
[88] Fix | Delete
}
[89] Fix | Delete
[90] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function