Version Description
- Code using create_function() has been removed to avoid security risks and warnings given when using with PHP 7.2+.
- Display the notice of config validation again to encourage admins to apply some important validation items recently added.
- REST API endpoint returns more specific HTTP status code 409 instead of 400.
- Fixed appearance of configuration error signs in the Additional Settings tab.
Download this release
Release Info
Developer | takayukister |
Plugin | Contact Form 7 |
Version | 4.9.1 |
Comparing to | |
See all releases |
Code changes from version 4.9 to 4.9.1
- admin/admin.php +12 -2
- admin/edit-contact-form.php +5 -1
- admin/includes/class-contact-forms-list-table.php +3 -0
- admin/includes/tag-generator.php +1 -0
- admin/includes/welcome-panel.php +14 -2
- admin/js/scripts.js +7 -7
- includes/contact-form-template.php +22 -10
- includes/formatting.php +7 -1
- includes/rest-api.php +1 -1
- readme.txt +9 -4
- settings.php +3 -1
- wp-contact-form-7.php +2 -2
admin/admin.php
CHANGED
@@ -376,6 +376,7 @@ function wpcf7_admin_management_page() {
|
|
376 |
|
377 |
if ( ! empty( $_REQUEST['s'] ) ) {
|
378 |
echo sprintf( '<span class="subtitle">'
|
|
|
379 |
. __( 'Search results for “%s”', 'contact-form-7' )
|
380 |
. '</span>', esc_html( $_REQUEST['s'] ) );
|
381 |
}
|
@@ -402,6 +403,7 @@ function wpcf7_admin_bulk_validate_page() {
|
|
402 |
$count = WPCF7_ContactForm::count();
|
403 |
|
404 |
$submit_text = sprintf(
|
|
|
405 |
_n(
|
406 |
"Validate %s Contact Form Now",
|
407 |
"Validate %s Contact Forms Now",
|
@@ -514,6 +516,7 @@ function wpcf7_admin_updated_message() {
|
|
514 |
|
515 |
if ( $count_invalid ) {
|
516 |
$updated_message = sprintf(
|
|
|
517 |
_n(
|
518 |
"Configuration validation completed. An invalid contact form was found.",
|
519 |
"Configuration validation completed. %s invalid contact forms were found.",
|
@@ -557,7 +560,10 @@ function wpcf7_old_wp_version_error() {
|
|
557 |
|
558 |
?>
|
559 |
<div class="notice notice-warning">
|
560 |
-
<p><?php
|
|
|
|
|
|
|
561 |
</div>
|
562 |
<?php
|
563 |
}
|
@@ -596,7 +602,11 @@ function wpcf7_notice_bulk_validate_config() {
|
|
596 |
return;
|
597 |
}
|
598 |
|
599 |
-
|
|
|
|
|
|
|
|
|
600 |
return;
|
601 |
}
|
602 |
|
376 |
|
377 |
if ( ! empty( $_REQUEST['s'] ) ) {
|
378 |
echo sprintf( '<span class="subtitle">'
|
379 |
+
/* translators: %s: search keywords */
|
380 |
. __( 'Search results for “%s”', 'contact-form-7' )
|
381 |
. '</span>', esc_html( $_REQUEST['s'] ) );
|
382 |
}
|
403 |
$count = WPCF7_ContactForm::count();
|
404 |
|
405 |
$submit_text = sprintf(
|
406 |
+
/* translators: %s: number of contact forms */
|
407 |
_n(
|
408 |
"Validate %s Contact Form Now",
|
409 |
"Validate %s Contact Forms Now",
|
516 |
|
517 |
if ( $count_invalid ) {
|
518 |
$updated_message = sprintf(
|
519 |
+
/* translators: %s: number of contact forms */
|
520 |
_n(
|
521 |
"Configuration validation completed. An invalid contact form was found.",
|
522 |
"Configuration validation completed. %s invalid contact forms were found.",
|
560 |
|
561 |
?>
|
562 |
<div class="notice notice-warning">
|
563 |
+
<p><?php
|
564 |
+
/* translators: 1: version of Contact Form 7, 2: version of WordPress, 3: URL */
|
565 |
+
echo sprintf( __( '<strong>Contact Form 7 %1$s requires WordPress %2$s or higher.</strong> Please <a href="%3$s">update WordPress</a> first.', 'contact-form-7' ), WPCF7_VERSION, WPCF7_REQUIRED_WP_VERSION, admin_url( 'update-core.php' ) );
|
566 |
+
?></p>
|
567 |
</div>
|
568 |
<?php
|
569 |
}
|
602 |
return;
|
603 |
}
|
604 |
|
605 |
+
$result = WPCF7::get_option( 'bulk_validate' );
|
606 |
+
$last_important_update = '4.9';
|
607 |
+
|
608 |
+
if ( ! empty( $result['version'] )
|
609 |
+
&& version_compare( $last_important_update, $result['version'], '<=' ) ) {
|
610 |
return;
|
611 |
}
|
612 |
|
admin/edit-contact-form.php
CHANGED
@@ -180,7 +180,10 @@ if ( $post ) :
|
|
180 |
|
181 |
<div id="postbox-container-2" class="postbox-container">
|
182 |
<div id="contact-form-editor">
|
183 |
-
<div class="keyboard-interaction"><?php
|
|
|
|
|
|
|
184 |
|
185 |
<?php
|
186 |
|
@@ -206,6 +209,7 @@ if ( $post ) :
|
|
206 |
|
207 |
$panels['additional-settings-panel'] = array(
|
208 |
'title' => $additional_settings
|
|
|
209 |
? sprintf(
|
210 |
__( 'Additional Settings (%d)', 'contact-form-7' ),
|
211 |
$additional_settings )
|
180 |
|
181 |
<div id="postbox-container-2" class="postbox-container">
|
182 |
<div id="contact-form-editor">
|
183 |
+
<div class="keyboard-interaction"><?php
|
184 |
+
/* translators: %s: ◀ ▶ dashicon */
|
185 |
+
echo sprintf( esc_html( __( '%s keys switch panels', 'contact-form-7' ) ), '<span class="dashicons dashicons-leftright"></span>' );
|
186 |
+
?></div>
|
187 |
|
188 |
<?php
|
189 |
|
209 |
|
210 |
$panels['additional-settings-panel'] = array(
|
211 |
'title' => $additional_settings
|
212 |
+
/* translators: %d: number of additional settings */
|
213 |
? sprintf(
|
214 |
__( 'Additional Settings (%d)', 'contact-form-7' ),
|
215 |
$additional_settings )
|
admin/includes/class-contact-forms-list-table.php
CHANGED
@@ -113,6 +113,7 @@ class WPCF7_Contact_Form_List_Table extends WP_List_Table {
|
|
113 |
$output = sprintf(
|
114 |
'<a class="row-title" href="%1$s" title="%2$s">%3$s</a>',
|
115 |
esc_url( $edit_link ),
|
|
|
116 |
esc_attr( sprintf( __( 'Edit “%s”', 'contact-form-7' ),
|
117 |
$item->title() ) ),
|
118 |
esc_html( $item->title() )
|
@@ -127,6 +128,7 @@ class WPCF7_Contact_Form_List_Table extends WP_List_Table {
|
|
127 |
|
128 |
if ( $count_errors = $config_validator->count_errors() ) {
|
129 |
$error_notice = sprintf(
|
|
|
130 |
_n(
|
131 |
'%s configuration error detected',
|
132 |
'%s configuration errors detected',
|
@@ -208,6 +210,7 @@ class WPCF7_Contact_Form_List_Table extends WP_List_Table {
|
|
208 |
$time_diff = time() - $time;
|
209 |
|
210 |
if ( $time_diff > 0 && $time_diff < 24*60*60 ) {
|
|
|
211 |
$h_time = sprintf(
|
212 |
__( '%s ago', 'contact-form-7' ), human_time_diff( $time ) );
|
213 |
} else {
|
113 |
$output = sprintf(
|
114 |
'<a class="row-title" href="%1$s" title="%2$s">%3$s</a>',
|
115 |
esc_url( $edit_link ),
|
116 |
+
/* translators: %s: title of contact form */
|
117 |
esc_attr( sprintf( __( 'Edit “%s”', 'contact-form-7' ),
|
118 |
$item->title() ) ),
|
119 |
esc_html( $item->title() )
|
128 |
|
129 |
if ( $count_errors = $config_validator->count_errors() ) {
|
130 |
$error_notice = sprintf(
|
131 |
+
/* translators: %s: number of errors detected */
|
132 |
_n(
|
133 |
'%s configuration error detected',
|
134 |
'%s configuration errors detected',
|
210 |
$time_diff = time() - $time;
|
211 |
|
212 |
if ( $time_diff > 0 && $time_diff < 24*60*60 ) {
|
213 |
+
/* translators: %s: time since the creation of the contact form */
|
214 |
$h_time = sprintf(
|
215 |
__( '%s ago', 'contact-form-7' ), human_time_diff( $time ) );
|
216 |
} else {
|
admin/includes/tag-generator.php
CHANGED
@@ -40,6 +40,7 @@ class WPCF7_TagGenerator {
|
|
40 |
echo sprintf(
|
41 |
'<a href="#TB_inline?width=900&height=500&inlineId=%1$s" class="thickbox button" title="%2$s">%3$s</a>',
|
42 |
esc_attr( $panel['content'] ),
|
|
|
43 |
esc_attr( sprintf(
|
44 |
__( 'Form-tag Generator: %s', 'contact-form-7' ),
|
45 |
$panel['title'] ) ),
|
40 |
echo sprintf(
|
41 |
'<a href="#TB_inline?width=900&height=500&inlineId=%1$s" class="thickbox button" title="%2$s">%3$s</a>',
|
42 |
esc_attr( $panel['content'] ),
|
43 |
+
/* translators: %s: title of form-tag like 'email' or 'checkboxes' */
|
44 |
esc_attr( sprintf(
|
45 |
__( 'Form-tag Generator: %s', 'contact-form-7' ),
|
46 |
$panel['title'] ) ),
|
admin/includes/welcome-panel.php
CHANGED
@@ -23,16 +23,28 @@ function wpcf7_welcome_panel() {
|
|
23 |
|
24 |
<p><?php echo esc_html( __( "Spammers target everything; your contact forms aren’t an exception. Before you get spammed, protect your contact forms with the powerful anti-spam features Contact Form 7 provides.", 'contact-form-7' ) ); ?></p>
|
25 |
|
26 |
-
<p><?php echo sprintf( esc_html( __( 'Contact Form 7 supports spam-filtering with %1$s. Intelligent %2$s blocks annoying spambots. Plus, using %3$s, you can block messages containing specified keywords or those sent from specified IP addresses.', 'contact-form-7' ) ), wpcf7_link( __( 'https://contactform7.com/spam-filtering-with-akismet/', 'contact-form-7' ), __( 'Akismet', 'contact-form-7' ) ), wpcf7_link( __( 'https://contactform7.com/recaptcha/', 'contact-form-7' ), __( 'reCAPTCHA', 'contact-form-7' ) ), wpcf7_link( __( 'https://contactform7.com/comment-blacklist/', 'contact-form-7' ), __( 'comment blacklist', 'contact-form-7' ) ) ); ?></p>
|
27 |
</div>
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
<div class="welcome-panel-column">
|
30 |
<h3><span class="dashicons dashicons-editor-help"></span> <?php echo esc_html( __( "Before you cry over spilt mail…", 'contact-form-7' ) ); ?></h3>
|
31 |
|
32 |
<p><?php echo esc_html( __( "Contact Form 7 doesn’t store submitted messages anywhere. Therefore, you may lose important messages forever if your mail server has issues or you make a mistake in mail configuration.", 'contact-form-7' ) ); ?></p>
|
33 |
|
34 |
-
<p><?php echo sprintf( esc_html( __( 'Install a message storage plugin before this happens to you. %s saves all messages through contact forms into the database. Flamingo is a free WordPress plugin created by the same author as Contact Form 7.', 'contact-form-7' ) ), wpcf7_link( __( 'https://contactform7.com/save-submitted-messages-with-flamingo/', 'contact-form-7' ), __( 'Flamingo', 'contact-form-7' ) ) ); ?></p>
|
35 |
</div>
|
|
|
36 |
|
37 |
</div>
|
38 |
</div>
|
23 |
|
24 |
<p><?php echo esc_html( __( "Spammers target everything; your contact forms aren’t an exception. Before you get spammed, protect your contact forms with the powerful anti-spam features Contact Form 7 provides.", 'contact-form-7' ) ); ?></p>
|
25 |
|
26 |
+
<p><?php /* translators: links labeled 1: 'Akismet', 2: 'reCAPTCHA', 3: 'comment blacklist' */ echo sprintf( esc_html( __( 'Contact Form 7 supports spam-filtering with %1$s. Intelligent %2$s blocks annoying spambots. Plus, using %3$s, you can block messages containing specified keywords or those sent from specified IP addresses.', 'contact-form-7' ) ), wpcf7_link( __( 'https://contactform7.com/spam-filtering-with-akismet/', 'contact-form-7' ), __( 'Akismet', 'contact-form-7' ) ), wpcf7_link( __( 'https://contactform7.com/recaptcha/', 'contact-form-7' ), __( 'reCAPTCHA', 'contact-form-7' ) ), wpcf7_link( __( 'https://contactform7.com/comment-blacklist/', 'contact-form-7' ), __( 'comment blacklist', 'contact-form-7' ) ) ); ?></p>
|
27 |
</div>
|
28 |
|
29 |
+
<?php if ( defined( 'FLAMINGO_VERSION' ) ) : ?>
|
30 |
+
<div class="welcome-panel-column">
|
31 |
+
<h3><span class="dashicons dashicons-megaphone"></span> <?php echo esc_html( __( "Contact Form 7 needs your support.", 'contact-form-7' ) ); ?></h3>
|
32 |
+
|
33 |
+
<p><?php echo esc_html( __( "It is hard to continue development and support for this plugin without contributions from users like you.", 'contact-form-7' ) ); ?></p>
|
34 |
+
|
35 |
+
<p><?php /* translators: %s: link labeled 'making a donation' */ echo sprintf( esc_html( __( 'If you enjoy using Contact Form 7 and find it useful, please consider %s.', 'contact-form-7' ) ), wpcf7_link( __( 'https://contactform7.com/donate/', 'contact-form-7' ), __( 'making a donation', 'contact-form-7' ) ) ); ?></p>
|
36 |
+
|
37 |
+
<p><?php echo esc_html( __( "Your donation will help encourage and support the plugin’s continued development and better user support.", 'contact-form-7' ) ); ?></p>
|
38 |
+
</div>
|
39 |
+
<?php else: ?>
|
40 |
<div class="welcome-panel-column">
|
41 |
<h3><span class="dashicons dashicons-editor-help"></span> <?php echo esc_html( __( "Before you cry over spilt mail…", 'contact-form-7' ) ); ?></h3>
|
42 |
|
43 |
<p><?php echo esc_html( __( "Contact Form 7 doesn’t store submitted messages anywhere. Therefore, you may lose important messages forever if your mail server has issues or you make a mistake in mail configuration.", 'contact-form-7' ) ); ?></p>
|
44 |
|
45 |
+
<p><?php /* translators: %s: link labeled 'Flamingo' */ echo sprintf( esc_html( __( 'Install a message storage plugin before this happens to you. %s saves all messages through contact forms into the database. Flamingo is a free WordPress plugin created by the same author as Contact Form 7.', 'contact-form-7' ) ), wpcf7_link( __( 'https://contactform7.com/save-submitted-messages-with-flamingo/', 'contact-form-7' ), __( 'Flamingo', 'contact-form-7' ) ) ); ?></p>
|
46 |
</div>
|
47 |
+
<?php endif; ?>
|
48 |
|
49 |
</div>
|
50 |
</div>
|
admin/js/scripts.js
CHANGED
@@ -175,11 +175,11 @@
|
|
175 |
var tab = section
|
176 |
.replace( /^mail_\d+\./, 'mail.' ).replace( /\..*$/, '' );
|
177 |
|
178 |
-
if ( ! errorCount[tab] ) {
|
179 |
-
errorCount[tab] = 0;
|
180 |
}
|
181 |
|
182 |
-
errorCount[tab] += 1;
|
183 |
|
184 |
errorCount.total += 1;
|
185 |
} );
|
@@ -196,7 +196,7 @@
|
|
196 |
$.each( errors, function( key, val ) {
|
197 |
key = key.replace( /^mail_\d+\./, 'mail.' );
|
198 |
|
199 |
-
if ( key.replace( /\..*$/, '' ) == tab ) {
|
200 |
var $mark = $( '<span class="dashicons dashicons-warning"></span>' );
|
201 |
$item.find( 'a.ui-tabs-anchor' ).first().append( $mark );
|
202 |
return false;
|
@@ -206,13 +206,13 @@
|
|
206 |
var $tabPanelError = $( '#' + tab + '-panel > div.config-error:first' );
|
207 |
$tabPanelError.empty();
|
208 |
|
209 |
-
if ( errorCount[tab] ) {
|
210 |
$tabPanelError
|
211 |
.append( '<span class="dashicons dashicons-warning"></span> ' );
|
212 |
|
213 |
-
if ( 1 < errorCount[tab] ) {
|
214 |
var manyErrorsInTab = wpcf7.configValidator.manyErrorsInTab
|
215 |
-
.replace( '%d', errorCount[tab] );
|
216 |
$tabPanelError.append( manyErrorsInTab );
|
217 |
} else {
|
218 |
$tabPanelError.append( wpcf7.configValidator.oneErrorInTab );
|
175 |
var tab = section
|
176 |
.replace( /^mail_\d+\./, 'mail.' ).replace( /\..*$/, '' );
|
177 |
|
178 |
+
if ( ! errorCount[ tab ] ) {
|
179 |
+
errorCount[ tab ] = 0;
|
180 |
}
|
181 |
|
182 |
+
errorCount[ tab ] += 1;
|
183 |
|
184 |
errorCount.total += 1;
|
185 |
} );
|
196 |
$.each( errors, function( key, val ) {
|
197 |
key = key.replace( /^mail_\d+\./, 'mail.' );
|
198 |
|
199 |
+
if ( key.replace( /\..*$/, '' ) == tab.replace( '-', '_' ) ) {
|
200 |
var $mark = $( '<span class="dashicons dashicons-warning"></span>' );
|
201 |
$item.find( 'a.ui-tabs-anchor' ).first().append( $mark );
|
202 |
return false;
|
206 |
var $tabPanelError = $( '#' + tab + '-panel > div.config-error:first' );
|
207 |
$tabPanelError.empty();
|
208 |
|
209 |
+
if ( errorCount[ tab.replace( '-', '_' ) ] ) {
|
210 |
$tabPanelError
|
211 |
.append( '<span class="dashicons dashicons-warning"></span> ' );
|
212 |
|
213 |
+
if ( 1 < errorCount[ tab.replace( '-', '_' ) ] ) {
|
214 |
var manyErrorsInTab = wpcf7.configValidator.manyErrorsInTab
|
215 |
+
.replace( '%d', errorCount[ tab ] );
|
216 |
$tabPanelError.append( manyErrorsInTab );
|
217 |
} else {
|
218 |
$tabPanelError.append( wpcf7.configValidator.oneErrorInTab );
|
includes/contact-form-template.php
CHANGED
@@ -46,20 +46,27 @@ class WPCF7_ContactFormTemplate {
|
|
46 |
|
47 |
public static function mail() {
|
48 |
$template = array(
|
49 |
-
'subject' =>
|
50 |
-
|
51 |
-
|
|
|
|
|
52 |
'sender' => sprintf( '[your-name] <%s>', self::from_email() ),
|
53 |
'body' =>
|
|
|
54 |
sprintf( __( 'From: %s', 'contact-form-7' ),
|
55 |
'[your-name] <[your-email]>' ) . "\n"
|
|
|
56 |
. sprintf( __( 'Subject: %s', 'contact-form-7' ),
|
57 |
'[your-subject]' ) . "\n\n"
|
58 |
. __( 'Message Body:', 'contact-form-7' )
|
59 |
. "\n" . '[your-message]' . "\n\n"
|
60 |
. '-- ' . "\n"
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
63 |
'recipient' => get_option( 'admin_email' ),
|
64 |
'additional_headers' => 'Reply-To: [your-email]',
|
65 |
'attachments' => '',
|
@@ -73,17 +80,22 @@ class WPCF7_ContactFormTemplate {
|
|
73 |
public static function mail_2() {
|
74 |
$template = array(
|
75 |
'active' => false,
|
76 |
-
'subject' =>
|
77 |
-
|
78 |
-
|
|
|
|
|
79 |
'sender' => sprintf( '%s <%s>',
|
80 |
get_bloginfo( 'name' ), self::from_email() ),
|
81 |
'body' =>
|
82 |
__( 'Message Body:', 'contact-form-7' )
|
83 |
. "\n" . '[your-message]' . "\n\n"
|
84 |
. '-- ' . "\n"
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
87 |
'recipient' => '[your-email]',
|
88 |
'additional_headers' => sprintf( 'Reply-To: %s',
|
89 |
get_option( 'admin_email' ) ),
|
46 |
|
47 |
public static function mail() {
|
48 |
$template = array(
|
49 |
+
'subject' =>
|
50 |
+
/* translators: 1: blog name, 2: [your-subject] */
|
51 |
+
sprintf(
|
52 |
+
_x( '%1$s "%2$s"', 'mail subject', 'contact-form-7' ),
|
53 |
+
get_bloginfo( 'name' ), '[your-subject]' ),
|
54 |
'sender' => sprintf( '[your-name] <%s>', self::from_email() ),
|
55 |
'body' =>
|
56 |
+
/* translators: %s: [your-name] <[your-email]> */
|
57 |
sprintf( __( 'From: %s', 'contact-form-7' ),
|
58 |
'[your-name] <[your-email]>' ) . "\n"
|
59 |
+
/* translators: %s: [your-subject] */
|
60 |
. sprintf( __( 'Subject: %s', 'contact-form-7' ),
|
61 |
'[your-subject]' ) . "\n\n"
|
62 |
. __( 'Message Body:', 'contact-form-7' )
|
63 |
. "\n" . '[your-message]' . "\n\n"
|
64 |
. '-- ' . "\n"
|
65 |
+
/* translators: 1: blog name, 2: blog URL */
|
66 |
+
. sprintf(
|
67 |
+
__( 'This e-mail was sent from a contact form on %1$s (%2$s)', 'contact-form-7' ),
|
68 |
+
get_bloginfo( 'name' ),
|
69 |
+
get_bloginfo( 'url' ) ),
|
70 |
'recipient' => get_option( 'admin_email' ),
|
71 |
'additional_headers' => 'Reply-To: [your-email]',
|
72 |
'attachments' => '',
|
80 |
public static function mail_2() {
|
81 |
$template = array(
|
82 |
'active' => false,
|
83 |
+
'subject' =>
|
84 |
+
/* translators: 1: blog name, 2: [your-subject] */
|
85 |
+
sprintf(
|
86 |
+
_x( '%1$s "%2$s"', 'mail subject', 'contact-form-7' ),
|
87 |
+
get_bloginfo( 'name' ), '[your-subject]' ),
|
88 |
'sender' => sprintf( '%s <%s>',
|
89 |
get_bloginfo( 'name' ), self::from_email() ),
|
90 |
'body' =>
|
91 |
__( 'Message Body:', 'contact-form-7' )
|
92 |
. "\n" . '[your-message]' . "\n\n"
|
93 |
. '-- ' . "\n"
|
94 |
+
/* translators: 1: blog name, 2: blog URL */
|
95 |
+
. sprintf(
|
96 |
+
__( 'This e-mail was sent from a contact form on %1$s (%2$s)', 'contact-form-7' ),
|
97 |
+
get_bloginfo( 'name' ),
|
98 |
+
get_bloginfo( 'url' ) ),
|
99 |
'recipient' => '[your-email]',
|
100 |
'additional_headers' => sprintf( 'Reply-To: %s',
|
101 |
get_option( 'admin_email' ) ),
|
includes/formatting.php
CHANGED
@@ -56,7 +56,9 @@ function wpcf7_autop( $pee, $br = 1 ) {
|
|
56 |
|
57 |
if ( $br ) {
|
58 |
/* wpcf7: add textarea */
|
59 |
-
$pee = preg_replace_callback(
|
|
|
|
|
60 |
$pee = preg_replace( '|(?<!<br />)\s*\n|', "<br />\n", $pee ); // optionally make line breaks
|
61 |
$pee = str_replace( '<WPPreserveNewline />', "\n", $pee );
|
62 |
|
@@ -78,6 +80,10 @@ function wpcf7_autop( $pee, $br = 1 ) {
|
|
78 |
return $pee;
|
79 |
}
|
80 |
|
|
|
|
|
|
|
|
|
81 |
function wpcf7_sanitize_query_var( $text ) {
|
82 |
$text = wp_unslash( $text );
|
83 |
$text = wp_check_invalid_utf8( $text );
|
56 |
|
57 |
if ( $br ) {
|
58 |
/* wpcf7: add textarea */
|
59 |
+
$pee = preg_replace_callback(
|
60 |
+
'/<(script|style|textarea).*?<\/\\1>/s',
|
61 |
+
'wpcf7_autop_preserve_newline_callback', $pee );
|
62 |
$pee = preg_replace( '|(?<!<br />)\s*\n|', "<br />\n", $pee ); // optionally make line breaks
|
63 |
$pee = str_replace( '<WPPreserveNewline />', "\n", $pee );
|
64 |
|
80 |
return $pee;
|
81 |
}
|
82 |
|
83 |
+
function wpcf7_autop_preserve_newline_callback( $matches ) {
|
84 |
+
return str_replace( "\n", '<WPPreserveNewline />', $matches[0] );
|
85 |
+
}
|
86 |
+
|
87 |
function wpcf7_sanitize_query_var( $text ) {
|
88 |
$text = wp_unslash( $text );
|
89 |
$text = wp_check_invalid_utf8( $text );
|
includes/rest-api.php
CHANGED
@@ -119,7 +119,7 @@ function wpcf7_rest_create_contact_form( WP_REST_Request $request ) {
|
|
119 |
if ( $id ) {
|
120 |
return new WP_Error( 'wpcf7_post_exists',
|
121 |
__( "Cannot create existing contact form.", 'contact-form-7' ),
|
122 |
-
array( 'status' =>
|
123 |
}
|
124 |
|
125 |
if ( ! current_user_can( 'wpcf7_edit_contact_forms' ) ) {
|
119 |
if ( $id ) {
|
120 |
return new WP_Error( 'wpcf7_post_exists',
|
121 |
__( "Cannot create existing contact form.", 'contact-form-7' ),
|
122 |
+
array( 'status' => 409 ) );
|
123 |
}
|
124 |
|
125 |
if ( ! current_user_can( 'wpcf7_edit_contact_forms' ) ) {
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: takayukister
|
|
3 |
Donate link: https://contactform7.com/donate/
|
4 |
Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, multilingual
|
5 |
Requires at least: 4.7
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 4.9
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -27,8 +27,6 @@ It is hard to continue development and support for this free plugin without cont
|
|
27 |
The following plugins are recommended for Contact Form 7 users:
|
28 |
|
29 |
* [Flamingo](https://wordpress.org/plugins/flamingo/) by Takayuki Miyoshi - With Flamingo, you can save submitted messages via contact forms in the database.
|
30 |
-
* [Postman](https://wordpress.org/plugins/postman-smtp/) by
|
31 |
-
Jason Hendriks - Postman is a next-generation SMTP Mailer, software that assists in the delivery of email generated by your WordPress site.
|
32 |
* [Bogo](https://wordpress.org/plugins/bogo/) by Takayuki Miyoshi - Bogo is a straight-forward multilingual plugin that doesn't cause headaches.
|
33 |
|
34 |
= Translations =
|
@@ -62,6 +60,13 @@ Do you have questions or issues with Contact Form 7? Use these support channels
|
|
62 |
|
63 |
For more information, see [Releases](https://contactform7.com/category/releases/).
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
= 4.9 =
|
66 |
|
67 |
* Supports subscribers_only setting
|
3 |
Donate link: https://contactform7.com/donate/
|
4 |
Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, multilingual
|
5 |
Requires at least: 4.7
|
6 |
+
Tested up to: 4.9
|
7 |
+
Stable tag: 4.9.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
27 |
The following plugins are recommended for Contact Form 7 users:
|
28 |
|
29 |
* [Flamingo](https://wordpress.org/plugins/flamingo/) by Takayuki Miyoshi - With Flamingo, you can save submitted messages via contact forms in the database.
|
|
|
|
|
30 |
* [Bogo](https://wordpress.org/plugins/bogo/) by Takayuki Miyoshi - Bogo is a straight-forward multilingual plugin that doesn't cause headaches.
|
31 |
|
32 |
= Translations =
|
60 |
|
61 |
For more information, see [Releases](https://contactform7.com/category/releases/).
|
62 |
|
63 |
+
= 4.9.1 =
|
64 |
+
|
65 |
+
* Code using create_function() has been removed to avoid security risks and warnings given when using with PHP 7.2+.
|
66 |
+
* Display the notice of config validation again to encourage admins to apply some important validation items recently added.
|
67 |
+
* REST API endpoint returns more specific HTTP status code 409 instead of 400.
|
68 |
+
* Fixed appearance of configuration error signs in the Additional Settings tab.
|
69 |
+
|
70 |
= 4.9 =
|
71 |
|
72 |
* Supports subscribers_only setting
|
settings.php
CHANGED
@@ -137,7 +137,9 @@ function wpcf7_install() {
|
|
137 |
|
138 |
$contact_form = WPCF7_ContactForm::get_template(
|
139 |
array(
|
140 |
-
'title' =>
|
|
|
|
|
141 |
)
|
142 |
);
|
143 |
|
137 |
|
138 |
$contact_form = WPCF7_ContactForm::get_template(
|
139 |
array(
|
140 |
+
'title' =>
|
141 |
+
/* translators: title of your first contact form. %d: number fixed to '1' */
|
142 |
+
sprintf( __( 'Contact form %d', 'contact-form-7' ), 1 ),
|
143 |
)
|
144 |
);
|
145 |
|
wp-contact-form-7.php
CHANGED
@@ -7,10 +7,10 @@ Author: Takayuki Miyoshi
|
|
7 |
Author URI: https://ideasilo.wordpress.com/
|
8 |
Text Domain: contact-form-7
|
9 |
Domain Path: /languages/
|
10 |
-
Version: 4.9
|
11 |
*/
|
12 |
|
13 |
-
define( 'WPCF7_VERSION', '4.9' );
|
14 |
|
15 |
define( 'WPCF7_REQUIRED_WP_VERSION', '4.7' );
|
16 |
|
7 |
Author URI: https://ideasilo.wordpress.com/
|
8 |
Text Domain: contact-form-7
|
9 |
Domain Path: /languages/
|
10 |
+
Version: 4.9.1
|
11 |
*/
|
12 |
|
13 |
+
define( 'WPCF7_VERSION', '4.9.1' );
|
14 |
|
15 |
define( 'WPCF7_REQUIRED_WP_VERSION', '4.7' );
|
16 |
|