rebase code on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:51:46 -04:00
parent b16ad94b69
commit 8f1a2c3a66
2197 changed files with 184921 additions and 35568 deletions

View File

@@ -12,27 +12,14 @@ trait WPCF7_ConfigValidator_Messages {
return;
}
if (
isset( $messages['captcha_not_match'] ) and
! wpcf7_use_really_simple_captcha()
) {
if ( isset( $messages['captcha_not_match'] )
and ! wpcf7_use_really_simple_captcha() ) {
unset( $messages['captcha_not_match'] );
}
foreach ( $messages as $key => $message ) {
$section = sprintf( 'messages.%s', $key );
if ( $this->supports( 'html_in_message' ) ) {
if ( $this->detect_html_in_message( $section, $message ) ) {
$this->add_error( $section, 'html_in_message',
array(
'message' => __( "HTML tags are used in a message.", 'contact-form-7' ),
)
);
} else {
$this->remove_error( $section, 'html_in_message' );
}
}
$this->detect_html_in_message( $section, $message );
}
}
@@ -45,8 +32,13 @@ trait WPCF7_ConfigValidator_Messages {
public function detect_html_in_message( $section, $content ) {
$stripped = wp_strip_all_tags( $content );
if ( $stripped !== $content ) {
return true;
if ( $stripped != $content ) {
return $this->add_error( $section,
'html_in_message',
array(
'message' => __( "HTML tags are used in a message.", 'contact-form-7' ),
)
);
}
return false;