WPtouch - Version 4.3.29

Version Description

Download this release

Release Info

Developer wptouch
Plugin Icon 128x128 WPtouch
Version 4.3.29
Comparing to
See all releases

Code changes from version 4.3.28 to 4.3.29

admin/js/wptouch-admin-4.js CHANGED
@@ -875,8 +875,8 @@ function wptouchTriggerSave( callback ) {
875
 
876
  if ( typeof( callback ) !== 'undefined' ) {
877
  callback();
878
- return false;
879
- };
880
  },
881
  cache: false
882
  });
875
 
876
  if ( typeof( callback ) !== 'undefined' ) {
877
  callback();
878
+ return false;
879
+ }
880
  },
881
  cache: false
882
  });
core/admin-settings.php CHANGED
@@ -39,8 +39,8 @@ function wptouch_settings_process( $wptouch_pro ) {
39
  // Search for all the settings to update
40
  foreach( $wptouch_pro->post as $key => $content ) {
41
  if ( preg_match( '#^wptouch__(.*)__(.*)#', $key, $match ) ) {
42
- $setting_domain = $match[1];
43
- $setting_name = $match[2];
44
 
45
  // Decode slashes on strings
46
  if ( is_string( $content ) ) {
@@ -62,8 +62,8 @@ function wptouch_settings_process( $wptouch_pro ) {
62
  // Do a loop and find all the checkboxes that should be disabled
63
  foreach( $wptouch_pro->post as $key => $content ) {
64
  if ( preg_match( '#^hid-wptouch__(.*)__(.*)#', $key, $match ) ) {
65
- $setting_domain = $match[1];
66
- $setting_name = $match[2];
67
 
68
  $new_settings[ $setting_domain ][ $setting_name ] = ( isset( $new_settings[ $setting_domain ][ $setting_name ] ) ? 1 : 0 );
69
 
@@ -75,9 +75,21 @@ function wptouch_settings_process( $wptouch_pro ) {
75
  foreach( $modified_domains as $domain => $ignored_value ) {
76
  $settings = $wptouch_pro->get_settings( $domain );
77
 
78
- // Update settings with new values
79
- foreach( $new_settings[ $domain ] as $key => $value ) {
80
  if ( isset( $settings->$key ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
81
  $settings->$key = $value;
82
  }
83
  }
39
  // Search for all the settings to update
40
  foreach( $wptouch_pro->post as $key => $content ) {
41
  if ( preg_match( '#^wptouch__(.*)__(.*)#', $key, $match ) ) {
42
+ $setting_domain = sanitize_text_field( $match[1] );
43
+ $setting_name = sanitize_text_field( $match[2] );
44
 
45
  // Decode slashes on strings
46
  if ( is_string( $content ) ) {
62
  // Do a loop and find all the checkboxes that should be disabled
63
  foreach( $wptouch_pro->post as $key => $content ) {
64
  if ( preg_match( '#^hid-wptouch__(.*)__(.*)#', $key, $match ) ) {
65
+ $setting_domain = sanitize_text_field( $match[1] );
66
+ $setting_name = sanitize_text_field( $match[2] );
67
 
68
  $new_settings[ $setting_domain ][ $setting_name ] = ( isset( $new_settings[ $setting_domain ][ $setting_name ] ) ? 1 : 0 );
69
 
75
  foreach( $modified_domains as $domain => $ignored_value ) {
76
  $settings = $wptouch_pro->get_settings( $domain );
77
 
78
+ // Sanitize and update settings with new values.
79
+ foreach ( $new_settings[ $domain ] as $key => $value ) {
80
  if ( isset( $settings->$key ) ) {
81
+ $key = sanitize_key( $key );
82
+ if ( 'custom_stats_code' === $key ) {
83
+ $value = wp_kses( $value, [
84
+ 'script' => true,
85
+ ] );
86
+ } else if ( is_numeric( $value ) ) {
87
+ $value = intval( $value );
88
+ } else if ( is_email( $value ) ) {
89
+ $value = sanitize_email( $value );
90
+ } else {
91
+ $value = sanitize_text_field( $value );
92
+ }
93
  $settings->$key = $value;
94
  }
95
  }
include/js/desktop-switch.min.js CHANGED
@@ -1 +1 @@
1
- function wptouchGetXMLHttpRequestObject(){if(window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(t){return null}}function wptouchAsyncHandler(){if(4==wptouchAjaxRequest.readyState&&200==wptouchAjaxRequest.status){var t=document.getElementById("wptouch_desktop_switch");null!=t&&(t.innerHTML=wptouchAjaxRequest.responseText)}}var wptouchAjaxRequest=wptouchGetXMLHttpRequestObject();null!=wptouchAjaxRequest&&(wptouchAjaxRequest.open("POST",wptouchAjaxUrl,!0),wptouchAjaxRequest.onreadystatechange=wptouchAsyncHandler,wptouchAjaxRequest.setRequestHeader("X-Requested-With","XMLHttpRequest"),wptouchAjaxRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded"),wptouchAjaxRequest.send("action=wptouch_client_ajax&wptouch_action=desktop_switch&wptouch_nonce="+encodeURIComponent(wptouchAjaxNonce)+"&wptouch_switch_location="+encodeURIComponent(wptouchAjaxSwitchLocation)));
1
+ function wptouchGetXMLHttpRequestObject(){if(window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(t){return null}}var wptouchAjaxRequest=wptouchGetXMLHttpRequestObject();function wptouchAsyncHandler(){if(4==wptouchAjaxRequest.readyState&&200==wptouchAjaxRequest.status){var t=document.getElementById("wptouch_desktop_switch");null!=t&&(t.innerHTML=wptouchAjaxRequest.responseText)}}null!=wptouchAjaxRequest&&(wptouchAjaxRequest.open("POST",wptouchAjaxUrl,!0),wptouchAjaxRequest.onreadystatechange=wptouchAsyncHandler,wptouchAjaxRequest.setRequestHeader("X-Requested-With","XMLHttpRequest"),wptouchAjaxRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded"),wptouchAjaxRequest.send("action=wptouch_client_ajax&wptouch_action=desktop_switch&wptouch_nonce="+encodeURIComponent(wptouchAjaxNonce)+"&wptouch_switch_location="+encodeURIComponent(wptouchAjaxSwitchLocation)));
include/js/wptouch.min.js CHANGED
@@ -1 +1 @@
1
- function WPtouchAjax(t,e,n){var o={action:"wptouch_client_ajax",wptouch_action:t,wptouch_nonce:wptouchMain.security_nonce};for(name in e)o[name]=e[name];jQuery.post(wptouchMain.ajaxurl,o,function(t){n(t)})}function doWPtouchReady(){wptouchMain.query_vars=jQuery.parseJSON(wptouchMain.query_vars);var t=jQuery(".wptouch-sc-content");if(t.length){var e={post_id:t.attr("data-post-id"),page:t.attr("data-page"),post_content:jQuery(".wptouch-orig-content").html(),post_nonce:wptouchMain.security_nonce};jQuery.post(wptouchMain.current_shortcode_url+"&current_time="+jQuery.now(),e,function(e){t.html(e),jQuery(document).trigger("wptouch_ajax_content_loaded")})}}jQuery("#content table").each(function(){parentElement=jQuery(this).parent("p,div"),parentElement.hasClass("post")===!1?parentElement.addClass("table-parent"):jQuery(this).wrap('<div class="table-parent"></div>')}),jQuery("#footer .back-to-top").click(function(t){t.preventDefault(),jQuery(window).scrollTop(0)}),jQuery(document).ready(function(){doWPtouchReady()});
1
+ function WPtouchAjax(t,e,n){var o={action:"wptouch_client_ajax",wptouch_action:t,wptouch_nonce:wptouchMain.security_nonce};for(name in e)o[name]=e[name];jQuery.post(wptouchMain.ajaxurl,o,function(t){n(t)})}function doWPtouchReady(){wptouchMain.query_vars=jQuery.parseJSON(wptouchMain.query_vars);var e=jQuery(".wptouch-sc-content");if(e.length){var t={post_id:e.attr("data-post-id"),page:e.attr("data-page"),post_content:jQuery(".wptouch-orig-content").html(),post_nonce:wptouchMain.security_nonce};jQuery.post(wptouchMain.current_shortcode_url+"&current_time="+jQuery.now(),t,function(t){e.html(t),jQuery(document).trigger("wptouch_ajax_content_loaded")})}}jQuery("#content table").each(function(){parentElement=jQuery(this).parent("p,div"),!1===parentElement.hasClass("post")?parentElement.addClass("table-parent"):jQuery(this).wrap('<div class="table-parent"></div>')}),jQuery("#footer .back-to-top").click(function(t){t.preventDefault(),jQuery(window).scrollTop(0)}),jQuery(document).ready(function(){doWPtouchReady()});
lang/wptouch.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the WPtouch Mobile Plugin package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WPtouch Mobile Plugin 4.3.28\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wptouch\n"
7
- "POT-Creation-Date: 2018-05-16 18:39:42+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -2087,7 +2087,7 @@ msgstr ""
2087
  msgid "Website"
2088
  msgstr ""
2089
 
2090
- #: themes/foundation/default/comments.php:77
2091
  msgid "Publish"
2092
  msgstr ""
2093
 
@@ -2533,9 +2533,9 @@ msgstr ""
2533
  msgid "WPtouch Mobile Plugin"
2534
  msgstr ""
2535
 
2536
- #. #-#-#-#-# wptouch.pot (WPtouch Mobile Plugin 4.3.28) #-#-#-#-#
2537
  #. Plugin URI of the plugin/theme
2538
- #. #-#-#-#-# wptouch.pot (WPtouch Mobile Plugin 4.3.28) #-#-#-#-#
2539
  #. Author URI of the plugin/theme
2540
  msgid "http://www.wptouch.com/"
2541
  msgstr ""
2
  # This file is distributed under the same license as the WPtouch Mobile Plugin package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WPtouch Mobile Plugin 4.3.29\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wptouch\n"
7
+ "POT-Creation-Date: 2018-10-16 18:19:13+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
2087
  msgid "Website"
2088
  msgstr ""
2089
 
2090
+ #: themes/foundation/default/comments.php:79
2091
  msgid "Publish"
2092
  msgstr ""
2093
 
2533
  msgid "WPtouch Mobile Plugin"
2534
  msgstr ""
2535
 
2536
+ #. #-#-#-#-# wptouch.pot (WPtouch Mobile Plugin 4.3.29) #-#-#-#-#
2537
  #. Plugin URI of the plugin/theme
2538
+ #. #-#-#-#-# wptouch.pot (WPtouch Mobile Plugin 4.3.29) #-#-#-#-#
2539
  #. Author URI of the plugin/theme
2540
  msgid "http://www.wptouch.com/"
2541
  msgstr ""
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: wptouch, sureswiftcapital, duanestorey, dalemugford, adamdipardo, oxymoron
3
  Tags: wptouch, iphone, ipod, bravenewcode, mobile, mobile-friendly, android, blackberry, smartphone, responsive, design, mobile plugin, ios, mobile theme
4
  Requires at least: 4.2
5
- Stable tag: 4.3.28
6
  Tested up to: 4.9
7
  License: GPLv2
8
 
@@ -33,6 +33,11 @@ For more information visit [WPtouch.com](http://www.wptouch.com/?utm_campaign=wp
33
 
34
  == Changelog ==
35
 
 
 
 
 
 
36
  = Version 4.3.28 (May 10th, 2018) =
37
 
38
  * Fixed: TypeError on setSelectionRange JavaScript error for email field on checkout page.
2
  Contributors: wptouch, sureswiftcapital, duanestorey, dalemugford, adamdipardo, oxymoron
3
  Tags: wptouch, iphone, ipod, bravenewcode, mobile, mobile-friendly, android, blackberry, smartphone, responsive, design, mobile plugin, ios, mobile theme
4
  Requires at least: 4.2
5
+ Stable tag: 4.3.29
6
  Tested up to: 4.9
7
  License: GPLv2
8
 
33
 
34
  == Changelog ==
35
 
36
+ = Version 4.3.29 (October 16th, 2018) =
37
+
38
+ * Fixed: Add helper file to output WordPress comment form cookie checkbox field for child themes that contain custom comment form layouts.
39
+ * Fixed: Potential XSS vulnerability relating to saving plugin settings in the WordPress admin.
40
+
41
  = Version 4.3.28 (May 10th, 2018) =
42
 
43
  * Fixed: TypeError on setSelectionRange JavaScript error for email field on checkout page.
themes/foundation/default/comments.php CHANGED
@@ -72,6 +72,8 @@
72
 
73
  <p><textarea name="comment" id="comment"></textarea></p>
74
 
 
 
75
  <?php do_action( 'comment_form', $post->ID ); ?>
76
 
77
  <p><button name="submit" type="submit" id="submit"><?php _e( 'Publish', 'wptouch-pro' ); ?></button></p>
72
 
73
  <p><textarea name="comment" id="comment"></textarea></p>
74
 
75
+ <?php foundation_output_comment_form_cookie_consent_checkbox(); ?>
76
+
77
  <?php do_action( 'comment_form', $post->ID ); ?>
78
 
79
  <p><button name="submit" type="submit" id="submit"><?php _e( 'Publish', 'wptouch-pro' ); ?></button></p>
themes/foundation/root-functions.php CHANGED
@@ -1435,3 +1435,22 @@ function foundation_sanitize_wptouch_settings( $settings ) {
1435
 
1436
  return $settings;
1437
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1435
 
1436
  return $settings;
1437
  }
1438
+
1439
+ /**
1440
+ * Outputs the comment form's cookie consent checkbox introduced in
1441
+ * WP core v4.9.6. This is used in themes that don't use the standard
1442
+ * WP core comment form via comment_form(), as that function now
1443
+ * outputs this field automatically.
1444
+ */
1445
+ function foundation_output_comment_form_cookie_consent_checkbox() {
1446
+ $commenter = wp_get_current_commenter();
1447
+ $consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
1448
+ ?>
1449
+ <p class="comment-form-cookies-consent body-font">
1450
+ <label for="wp-comment-cookies-consent" class="body-font">
1451
+ <input class="body-font" id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes" <?php echo $consent; ?> />
1452
+ Save my name, email, and website in this browser for the next time I comment.
1453
+ </label>
1454
+ </p>
1455
+ <?php
1456
+ }
wptouch.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: WPtouch Mobile Plugin
4
  Plugin URI: http://www.wptouch.com/
5
- Version: 4.3.28
6
  Description: Make a beautiful mobile-friendly version of your website with just a few clicks.
7
  Author: WPtouch
8
  Author URI: http://www.wptouch.com/
@@ -14,7 +14,7 @@
14
 
15
  function wptouch_create_four_object() {
16
  if ( !defined( 'WPTOUCH_IS_PRO' ) ) {
17
- define( 'WPTOUCH_VERSION', '4.3.28' );
18
 
19
  define( 'WPTOUCH_BASE_NAME', basename( __FILE__, '.php' ) . '.php' );
20
  define( 'WPTOUCH_DIR', WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . basename( __FILE__, '.php' ) );
2
  /*
3
  Plugin Name: WPtouch Mobile Plugin
4
  Plugin URI: http://www.wptouch.com/
5
+ Version: 4.3.29
6
  Description: Make a beautiful mobile-friendly version of your website with just a few clicks.
7
  Author: WPtouch
8
  Author URI: http://www.wptouch.com/
14
 
15
  function wptouch_create_four_object() {
16
  if ( !defined( 'WPTOUCH_IS_PRO' ) ) {
17
+ define( 'WPTOUCH_VERSION', '4.3.29' );
18
 
19
  define( 'WPTOUCH_BASE_NAME', basename( __FILE__, '.php' ) . '.php' );
20
  define( 'WPTOUCH_DIR', WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . basename( __FILE__, '.php' ) );