Nimble Page Builder - Version 3.2.5

Version Description

Visit the Github release page.

Download this release

Release Info

Developer nikeo
Plugin Icon 128x128 Nimble Page Builder
Version 3.2.5
Comparing to
See all releases

Code changes from version 3.2.4 to 3.2.5

inc/sektions/ccat-constants-and-helper-functions.php CHANGED
@@ -3217,16 +3217,38 @@ function sek_get_th_start_ver( $theme_name ) {
3217
  * STRIP SCRIPT TAG WHEN CUSTOMIZING
3218
  * to prevent customizer breakages. See https://github.com/presscustomizr/nimble-builder/issues/688
3219
  /* ------------------------------------------------------------------------- */
3220
- function sek_strip_script_tags_when_customizing( $html = '' ) {
3221
- if ( !skp_is_customizing() || !is_string( $html ) ) {
3222
- return $html;
3223
- }
3224
- // June 2020 => added a notice for https://github.com/presscustomizr/nimble-builder/issues/710
3225
- $script_notice = sprintf('<div class="nimble-notice-in-preview"><i class="fas fa-info-circle"></i>&nbsp;%1$s</div>',
3226
- __('Custom javascript code is not executed when customizing.', 'nimble-builder')
3227
- );
3228
- return preg_replace('#<script(.*?)>(.*?)</script>#is', $script_notice, $html);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3229
  }
 
3230
  function sek_strip_script_tags( $html = '' ) {
3231
  if (!is_string( $html ) ) {
3232
  return $html;
3217
  * STRIP SCRIPT TAG WHEN CUSTOMIZING
3218
  * to prevent customizer breakages. See https://github.com/presscustomizr/nimble-builder/issues/688
3219
  /* ------------------------------------------------------------------------- */
3220
+ function sek_strip_script_tags_and_print_js_inline( $html, $model ) {
3221
+ if ( !is_string( $html ) )
3222
+ return $html;
3223
+ if ( skp_is_customizing() ) {
3224
+ // June 2020 => added a notice for https://github.com/presscustomizr/nimble-builder/issues/710
3225
+ $script_notice = sprintf('<div class="nimble-notice-in-preview"><i class="fas fa-info-circle"></i>&nbsp;%1$s</div>',
3226
+ __('Custom javascript code is not executed when customizing.', 'nimble-builder')
3227
+ );
3228
+ return preg_replace('#<script(.*?)>(.*?)</script>#is', $script_notice, $html);
3229
+ } else {
3230
+ $js = "";
3231
+ // Get the script tags content
3232
+ preg_match_all('/<script>(.*?)<\/script>/s', $html, $matches);
3233
+ foreach ($matches[1] as $value) {
3234
+ if (!empty($value)) {
3235
+ $js .= $value .";\n";
3236
+ }
3237
+ }
3238
+
3239
+ // Remove the scripts from the content
3240
+ $html = preg_replace('#<script(.*?)</script>#is', '', $html);
3241
+
3242
+ // Print scripts inline safely
3243
+ if ( !empty($js) ) {
3244
+ wp_register_script( 'nb_module_custom_js_' . $model['id'], '');
3245
+ wp_enqueue_script( 'nb_module_custom_js_' . $model['id'] );
3246
+ wp_add_inline_script( 'nb_module_custom_js_' . $model['id'], $js );
3247
+ }
3248
+ return $html;
3249
+ }
3250
  }
3251
+
3252
  function sek_strip_script_tags( $html = '' ) {
3253
  if (!is_string( $html ) ) {
3254
  return $html;
inc/sektions/ccat-sektions-base.php CHANGED
@@ -5772,7 +5772,7 @@ class Sek_Simple_Form extends SEK_Front_Render_Css {
5772
  $user_form_composition[$field_id] = $field_data;
5773
  $user_form_composition[$field_id]['required'] = sek_is_checked( $form_fields_options['privacy_field_required'] );
5774
  // prevent users running script in this field while customizing
5775
- $user_form_composition[$field_id]['label'] = sek_strip_script_tags_when_customizing( $form_fields_options['privacy_field_label'] );
5776
  // Feb 2021 : now saved as a json to fix emojis issues
5777
  // see fix for https://github.com/presscustomizr/nimble-builder/issues/544
5778
  // to ensure retrocompatibility with data previously not saved as json, we need to perform a json validity check
@@ -5957,8 +5957,9 @@ class Sek_Form {
5957
  $fields .= $field;
5958
  }
5959
 
 
5960
  return sprintf('<form %1$s>%2$s</form>',
5961
- esc_attr($this->get_attributes_html()),
5962
  $fields
5963
  );
5964
  }
5772
  $user_form_composition[$field_id] = $field_data;
5773
  $user_form_composition[$field_id]['required'] = sek_is_checked( $form_fields_options['privacy_field_required'] );
5774
  // prevent users running script in this field while customizing
5775
+ $user_form_composition[$field_id]['label'] = sek_strip_script_tags_and_print_js_inline( $form_fields_options['privacy_field_label'], $module_model );
5776
  // Feb 2021 : now saved as a json to fix emojis issues
5777
  // see fix for https://github.com/presscustomizr/nimble-builder/issues/544
5778
  // to ensure retrocompatibility with data previously not saved as json, we need to perform a json validity check
5957
  $fields .= $field;
5958
  }
5959
 
5960
+ // The form output is late escaped on rendering in tmpl\modules\simple_form_module_tmpl.php
5961
  return sprintf('<form %1$s>%2$s</form>',
5962
+ $this->get_attributes_html(),
5963
  $fields
5964
  );
5965
  }
nimble-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Nimble Page Builder
4
  * Plugin URI: https://nimblebuilder.com
5
  * Description: Simple and smart companion that allows you to insert sections into any existing page, create landing pages or entire websites including header and footer.
6
- * Version: 3.2.4
7
  * Text Domain: nimble-builder
8
  * Author: Press Customizr
9
  * Author URI: https://nimblebuilder.com/?utm_source=wp-plugins&utm_medium=wp-dashboard&utm_campaign=author-uri
@@ -16,7 +16,7 @@ if ( !defined( 'ABSPATH' ) ) {
16
  /* ------------------------------------------------------------------------- *
17
  * CONSTANTS
18
  /* ------------------------------------------------------------------------- */
19
- $current_version = "3.2.4";
20
 
21
  if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
22
  if ( !defined( 'NIMBLE_DIR_NAME' ) ) { define( 'NIMBLE_DIR_NAME' , basename( dirname( __FILE__ ) ) ); }
3
  * Plugin Name: Nimble Page Builder
4
  * Plugin URI: https://nimblebuilder.com
5
  * Description: Simple and smart companion that allows you to insert sections into any existing page, create landing pages or entire websites including header and footer.
6
+ * Version: 3.2.5
7
  * Text Domain: nimble-builder
8
  * Author: Press Customizr
9
  * Author URI: https://nimblebuilder.com/?utm_source=wp-plugins&utm_medium=wp-dashboard&utm_campaign=author-uri
16
  /* ------------------------------------------------------------------------- *
17
  * CONSTANTS
18
  /* ------------------------------------------------------------------------- */
19
+ $current_version = "3.2.5";
20
 
21
  if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
22
  if ( !defined( 'NIMBLE_DIR_NAME' ) ) { define( 'NIMBLE_DIR_NAME' , basename( dirname( __FILE__ ) ) ); }
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: page builder, visual editor, customizer, drag and drop, header, footer, la
6
  Requires at least: 4.7
7
  Requires PHP: 5.4
8
  Tested up to: 5.9
9
- Stable tag: 3.2.4
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8FMNQPU36U27J&source=url
6
  Requires at least: 4.7
7
  Requires PHP: 5.4
8
  Tested up to: 5.9
9
+ Stable tag: 3.2.5
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8FMNQPU36U27J&source=url
tmpl/modules/simple_html_module_tmpl.php CHANGED
@@ -25,7 +25,7 @@ if ( !function_exists( 'Nimble\sek_print_html_content') ) {
25
  $html_content = sek_parse_template_tags( $html_content );
26
 
27
  // added may 2020 related to https://github.com/presscustomizr/nimble-builder/issues/688
28
- $html_content = sek_strip_script_tags_when_customizing( $html_content );
29
 
30
  //TODO: move add_filter 'sek_html_content' somewhere else so it's called once
31
  //and we won't need to remove it
25
  $html_content = sek_parse_template_tags( $html_content );
26
 
27
  // added may 2020 related to https://github.com/presscustomizr/nimble-builder/issues/688
28
+ $html_content = sek_strip_script_tags_and_print_js_inline( $html_content, Nimble_Manager()->model );
29
 
30
  //TODO: move add_filter 'sek_html_content' somewhere else so it's called once
31
  //and we won't need to remove it
tmpl/modules/tinymce_editor_module_tmpl.php CHANGED
@@ -25,16 +25,16 @@ if ( !function_exists( 'Nimble\sek_print_tiny_mce_text_content') ) {
25
  // see fix for https://github.com/presscustomizr/nimble-builder/issues/544
26
  // to ensure retrocompatibility with data previously not saved as json, we need to perform a json validity check
27
  $content = sek_maybe_decode_richtext( $tiny_mce_content );
28
-
29
  // Use our own content filter instead of $content = apply_filters( 'the_content', $tiny_mce_content );
30
  // because of potential third party plugins corrupting 'the_content' filter. https://github.com/presscustomizr/nimble-builder/issues/233
31
  if ( false === sek_booleanize_checkbox_val( $value['autop'] ) ) {
32
  add_filter( 'the_nimble_tinymce_module_content', 'wpautop');
33
  }
34
  if ( skp_is_customizing() ) {
35
- printf('<div title="%3$s" data-sek-input-type="detached_tinymce_editor" data-sek-input-id="%1$s">%2$s</div>', esc_attr($input_id), apply_filters( 'the_nimble_tinymce_module_content', wp_kses_post(sek_strip_script_tags_when_customizing( $content ) )), __( 'Click to edit', 'nimble-builder' ) );
36
  } else {
37
- echo apply_filters( 'nimble_parse_for_smart_load', apply_filters( 'the_nimble_tinymce_module_content', wp_kses_post(sek_strip_script_tags_when_customizing( $content ) )) );
38
  }
39
  }
40
  }
25
  // see fix for https://github.com/presscustomizr/nimble-builder/issues/544
26
  // to ensure retrocompatibility with data previously not saved as json, we need to perform a json validity check
27
  $content = sek_maybe_decode_richtext( $tiny_mce_content );
28
+ $content = sek_strip_script_tags_and_print_js_inline( $content, Nimble_Manager()->model );
29
  // Use our own content filter instead of $content = apply_filters( 'the_content', $tiny_mce_content );
30
  // because of potential third party plugins corrupting 'the_content' filter. https://github.com/presscustomizr/nimble-builder/issues/233
31
  if ( false === sek_booleanize_checkbox_val( $value['autop'] ) ) {
32
  add_filter( 'the_nimble_tinymce_module_content', 'wpautop');
33
  }
34
  if ( skp_is_customizing() ) {
35
+ printf('<div title="%3$s" data-sek-input-type="detached_tinymce_editor" data-sek-input-id="%1$s">%2$s</div>', esc_attr($input_id), apply_filters( 'the_nimble_tinymce_module_content', wp_kses_post($content)), __( 'Click to edit', 'nimble-builder' ) );
36
  } else {
37
+ echo apply_filters( 'nimble_parse_for_smart_load', apply_filters( 'the_nimble_tinymce_module_content', wp_kses_post($content)) );
38
  }
39
  }
40
  }