Contact Form 7 - Version 4.5.1

Version Description

  • Avoids JavaScript strict-mode errors seen with ill-designed themes.
  • Fixed a bug around reCAPTCHA's callback and expired-callback options.
  • Specifies cursor style for file uploading fields.
  • Corrects language tags for locale codes with modifying suffix like '_formal'.
  • Corrects wpcf7_is_rtl() output. Added 5 locales to the RTL locales list.
  • Language Packs: Language files for Portuguese (Brazil) (pt_BR) and Hebrew (he_IL) have been removed.
Download this release

Release Info

Developer takayukister
Plugin Icon 128x128 Contact Form 7
Version 4.5.1
Comparing to
See all releases

Code changes from version 4.5 to 4.5.1

includes/contact-form.php CHANGED
@@ -258,12 +258,18 @@ class WPCF7_ContactForm {
258
259
$this->unit_tag = self::get_unit_tag( $this->id );
260
261
$html = sprintf( '<div %s>', wpcf7_format_atts( array(
262
'role' => 'form',
263
'class' => 'wpcf7',
264
'id' => $this->unit_tag,
265
( get_option( 'html_type' ) == 'text/html' ) ? 'lang' : 'xml:lang'
266
- => str_replace( '_', '-', $this->locale ),
267
'dir' => wpcf7_is_rtl( $this->locale ) ? 'rtl' : 'ltr' ) ) ) . "\n";
268
269
$html .= $this->screen_reader_response() . "\n";
258
259
$this->unit_tag = self::get_unit_tag( $this->id );
260
261
+ $lang_tag = str_replace( '_', '-', $this->locale );
262
+
263
+ if ( preg_match( '/^([a-z]+-[a-z]+)-/i', $lang_tag, $matches ) ) {
264
+ $lang_tag = $matches[1];
265
+ }
266
+
267
$html = sprintf( '<div %s>', wpcf7_format_atts( array(
268
'role' => 'form',
269
'class' => 'wpcf7',
270
'id' => $this->unit_tag,
271
( get_option( 'html_type' ) == 'text/html' ) ? 'lang' : 'xml:lang'
272
+ => $lang_tag,
273
'dir' => wpcf7_is_rtl( $this->locale ) ? 'rtl' : 'ltr' ) ) ) . "\n";
274
275
$html .= $this->screen_reader_response() . "\n";
includes/css/styles.css CHANGED
@@ -77,6 +77,14 @@ div.wpcf7 .placeheld {
77
color: #888;
78
}
79
80
- .wpcf7-recaptcha iframe {
81
margin-bottom: 0;
82
}
77
color: #888;
78
}
79
80
+ div.wpcf7 .wpcf7-recaptcha iframe {
81
margin-bottom: 0;
82
}
83
+
84
+ div.wpcf7 input[type="file"] {
85
+ cursor: pointer;
86
+ }
87
+
88
+ div.wpcf7 input[type="file"]:disabled {
89
+ cursor: default;
90
+ }
includes/js/scripts.js CHANGED
@@ -3,7 +3,7 @@
3
'use strict';
4
5
if (typeof _wpcf7 == 'undefined' || _wpcf7 === null) {
6
- _wpcf7 = {};
7
}
8
9
_wpcf7 = $.extend({
3
'use strict';
4
5
if (typeof _wpcf7 == 'undefined' || _wpcf7 === null) {
6
+ return;
7
}
8
9
_wpcf7 = $.extend({
includes/l10n.php CHANGED
@@ -37,14 +37,23 @@ function wpcf7_is_valid_locale( $locale ) {
37
}
38
39
function wpcf7_is_rtl( $locale = '' ) {
40
- if ( empty( $locale ) ) {
41
- return function_exists( 'is_rtl' ) ? is_rtl() : false;
42
- }
43
-
44
- $rtl_locales = array(
45
'ar' => 'Arabic',
46
'he_IL' => 'Hebrew',
47
- 'fa_IR' => 'Persian' );
48
49
return isset( $rtl_locales[$locale] );
50
}
37
}
38
39
function wpcf7_is_rtl( $locale = '' ) {
40
+ static $rtl_locales = array(
41
'ar' => 'Arabic',
42
+ 'ary' => 'Moroccan Arabic',
43
+ 'azb' => 'South Azerbaijani',
44
+ 'fa_IR' => 'Persian',
45
+ 'haz' => 'Hazaragi',
46
'he_IL' => 'Hebrew',
47
+ 'ps' => 'Pashto',
48
+ 'ug_CN' => 'Uighur' );
49
+
50
+ if ( empty( $locale ) && function_exists( 'is_rtl' ) ) {
51
+ return is_rtl();
52
+ }
53
+
54
+ if ( empty( $locale ) ) {
55
+ $locale = get_locale();
56
+ }
57
58
return isset( $rtl_locales[$locale] );
59
}
languages/contact-form-7-he_IL.mo DELETED
Binary file
languages/contact-form-7-pt_BR.mo DELETED
Binary file
modules/recaptcha.php CHANGED
@@ -261,16 +261,27 @@ var recaptchaCallback = function() {
261
var sitekey = divs[j].getAttribute('data-sitekey');
262
263
if (divs[j].className && divs[j].className.match(pattern) && sitekey) {
264
- var widget_id = grecaptcha.render(divs[j], {
265
'sitekey': sitekey,
266
'theme': divs[j].getAttribute('data-theme'),
267
'type': divs[j].getAttribute('data-type'),
268
'size': divs[j].getAttribute('data-size'),
269
- 'tabindex': divs[j].getAttribute('data-tabindex'),
270
- 'callback': divs[j].getAttribute('data-callback'),
271
- 'expired-callback': divs[j].getAttribute('data-expired-callback')
272
- });
273
274
recaptchaWidgets.push(widget_id);
275
break;
276
}
@@ -306,7 +317,7 @@ function wpcf7_recaptcha_shortcode_handler( $tag ) {
306
$atts['data-tabindex'] = $tag->get_option( 'tabindex', 'int', true );
307
$atts['data-callback'] = $tag->get_option( 'callback', '', true );
308
$atts['data-expired-callback'] =
309
- $tag->get_option( 'expired-callback', '', true );
310
311
$atts['class'] = $tag->get_class_option(
312
wpcf7_form_controls_class( $tag->type, 'g-recaptcha' ) );
261
var sitekey = divs[j].getAttribute('data-sitekey');
262
263
if (divs[j].className && divs[j].className.match(pattern) && sitekey) {
264
+ var params = {
265
'sitekey': sitekey,
266
'theme': divs[j].getAttribute('data-theme'),
267
'type': divs[j].getAttribute('data-type'),
268
'size': divs[j].getAttribute('data-size'),
269
+ 'tabindex': divs[j].getAttribute('data-tabindex')
270
+ };
271
272
+ var callback = divs[j].getAttribute('data-callback');
273
+
274
+ if (callback && 'function' == typeof window[callback]) {
275
+ params['callback'] = window[callback];
276
+ }
277
+
278
+ var expired_callback = divs[j].getAttribute('data-expired-callback');
279
+
280
+ if (expired_callback && 'function' == typeof window[expired_callback]) {
281
+ params['expired-callback'] = window[expired_callback];
282
+ }
283
+
284
+ var widget_id = grecaptcha.render(divs[j], params);
285
recaptchaWidgets.push(widget_id);
286
break;
287
}
317
$atts['data-tabindex'] = $tag->get_option( 'tabindex', 'int', true );
318
$atts['data-callback'] = $tag->get_option( 'callback', '', true );
319
$atts['data-expired-callback'] =
320
+ $tag->get_option( 'expired_callback', '', true );
321
322
$atts['class'] = $tag->get_class_option(
323
wpcf7_form_controls_class( $tag->type, 'g-recaptcha' ) );
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: takayukister
3
Donate link: http://contactform7.com/donate/
4
Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, multilingual
5
Requires at least: 4.4
6
- Tested up to: 4.6
7
- Stable tag: 4.5
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -62,6 +62,15 @@ Do you have questions or issues with Contact Form 7? Use these support channels
62
63
For more information, see [Releases](http://contactform7.com/category/releases/).
64
65
= 4.5 =
66
67
* The default contact form template is revised.
@@ -70,25 +79,3 @@ For more information, see [Releases](http://contactform7.com/category/releases/)
70
* The config validator is revised. The wpcf7_config_validator_validate action hook is introduced to allow 3rd-party to cut in.
71
* A bug in character count form-tag is fixed.
72
* Language Packs: Language files for Danish (da_DK), Polish (pl_PL), and Czech (cs_CZ) have been removed from the plugin package.
73
-
74
- = 4.4.2 =
75
-
76
- * Language Packs: Language files for French (fr_FR), Russian (ru_RU), Slovak (sk_SK), and Turkish (tr_TR) have been removed from the plugin package.
77
- * Config Validation: Interoperability support for WordPress MU Domain Mapping plugin: Treats a mapping domain as the site domain when you compare an email address with the site domain.
78
- * Config Validation: Made email-in-site-domain verification case-insensitive.
79
-
80
- = 4.4.1 =
81
-
82
- * Config Validation: Added a link to FAQ.
83
- * Config Validation: Relaxed email domain validation.
84
- * Config Validation: Added mail header syntax check for Cc, Bcc, and Reply-To.
85
- * Fixed: Incorrect character count for quotation marks.
86
- * Language Packs: Language files for German (de_DE), Italian (it_IT), Romanian (ro_RO), Estonian (et), Spanish (es_ES), and Finnish (fi) have been removed.
87
-
88
- = 4.4 =
89
-
90
- * The configuration validator has been introduced.
91
- * The language selector has been removed from Add New Contact Form screen.
92
- * Attach a plain text version of the message when sending HTML mail.
93
- * Added do_not_store additional setting to tell data storage add-ons not to store data through the contact form.
94
- * The minimum required WordPress version has been changed from 4.2 to 4.3.
3
Donate link: http://contactform7.com/donate/
4
Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, multilingual
5
Requires at least: 4.4
6
+ Tested up to: 4.6.1
7
+ Stable tag: 4.5.1
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
62
63
For more information, see [Releases](http://contactform7.com/category/releases/).
64
65
+ = 4.5.1 =
66
+
67
+ * Avoids JavaScript strict-mode errors seen with ill-designed themes.
68
+ * Fixed a bug around reCAPTCHA's callback and expired-callback options.
69
+ * Specifies cursor style for file uploading fields.
70
+ * Corrects language tags for locale codes with modifying suffix like '_formal'.
71
+ * Corrects wpcf7_is_rtl() output. Added 5 locales to the RTL locales list.
72
+ * Language Packs: Language files for Portuguese (Brazil) (pt_BR) and Hebrew (he_IL) have been removed.
73
+
74
= 4.5 =
75
76
* The default contact form template is revised.
79
* The config validator is revised. The wpcf7_config_validator_validate action hook is introduced to allow 3rd-party to cut in.
80
* A bug in character count form-tag is fixed.
81
* Language Packs: Language files for Danish (da_DK), Polish (pl_PL), and Czech (cs_CZ) have been removed from the plugin package.
wp-contact-form-7.php CHANGED
@@ -7,10 +7,10 @@ Author: Takayuki Miyoshi
7
Author URI: http://ideasilo.wordpress.com/
8
Text Domain: contact-form-7
9
Domain Path: /languages/
10
- Version: 4.5
11
*/
12
13
- define( 'WPCF7_VERSION', '4.5' );
14
15
define( 'WPCF7_REQUIRED_WP_VERSION', '4.4' );
16
7
Author URI: http://ideasilo.wordpress.com/
8
Text Domain: contact-form-7
9
Domain Path: /languages/
10
+ Version: 4.5.1
11
*/
12
13
+ define( 'WPCF7_VERSION', '4.5.1' );
14
15
define( 'WPCF7_REQUIRED_WP_VERSION', '4.4' );
16