iubenda Cookie Solution for GDPR - Version 1.15.1

Version Description

  • Fix: iubenda code field removing HTML tags on save
  • Tweak: Adjusted the script blocking regex in shortcode
Download this release

Release Info

Developer dfactory
Plugin Icon 128x128 iubenda Cookie Solution for GDPR
Version 1.15.1
Comparing to
See all releases

Code changes from version 1.15.0 to 1.15.1

Files changed (2) hide show
  1. iubenda_cookie_solution.php +43 -10
  2. readme.txt +9 -6
iubenda_cookie_solution.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: iubenda Cookie Solution for GDPR
4
  Plugin URI: https://www.iubenda.com
5
  Description: iubenda Cookie Solution allows you to make your website GDPR compliant and manage all aspects of cookie law on WP.
6
- Version: 1.15.0
7
  Author: iubenda
8
  Author URI: https://www.iubenda.com
9
  License: MIT License
@@ -35,7 +35,7 @@ $iubenda_cookie_law_solution = new iubenda_Cookie_Law_Solution();
35
  * iubenda_Cookie_Law_Solution final class.
36
  *
37
  * @class iubenda_Cookie_Law_Solution
38
- * @version 1.15.0
39
  */
40
  class iubenda_Cookie_Law_Solution {
41
 
@@ -51,7 +51,7 @@ class iubenda_Cookie_Law_Solution {
51
  'menu_position' => 'topmenu',
52
  'deactivation' => false
53
  );
54
- public $version = '1.15.0';
55
  public $no_html = false;
56
  public $links = array();
57
  public $multilang = false;
@@ -256,7 +256,7 @@ class iubenda_Cookie_Law_Solution {
256
  * @return mixed
257
  */
258
  public function shortcode( $atts, $content = '' ) {
259
- return '<!--IUB_COOKIE_POLICY_START-->' . do_shortcode( $content ) . '<!--IUB_COOKIE_POLICY_END-->';
260
  }
261
 
262
  /**
@@ -571,9 +571,9 @@ class iubenda_Cookie_Law_Solution {
571
  <div class="contextual-help-tabs-wrap">';
572
  foreach ( $this->languages as $lang_id => $lang_name ) {
573
  // get code for the language
574
- $code = ! empty( $this->options['code_' . $lang_id] ) ? html_entity_decode( trim( wp_kses( $this->options['code_' . $lang_id], array( 'style' => array( 'type' => array() ), 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) ) ) : '';
575
  // handle default, if empty
576
- $code = empty( $code ) && $lang_id == $this->lang_default ? html_entity_decode( trim( wp_kses( $this->options['code_default'], array( 'style' => array( 'type' => array() ), 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) ) ) : $code;
577
 
578
  echo '
579
  <div id="tab-panel-' . $lang_id . '" class="help-tab-content' . ( $this->lang_default == $lang_id ? ' active' : '' ) . '">
@@ -588,7 +588,7 @@ class iubenda_Cookie_Law_Solution {
588
  } else {
589
  echo '
590
  <div id="iub_code_default">
591
- <textarea name="iubenda_cookie_law_solution[code_default]" class="large-text" cols="50" rows="10">' . html_entity_decode( trim( wp_kses( $this->options['code_default'], array( 'style' => array( 'type' => array() ), 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) ) ) . '</textarea>
592
  <p class="description">' . __( 'Enter the iubenda code.', 'iubenda-cookie-law-solution' ) . '</p>
593
  </div>';
594
  }
@@ -690,15 +690,15 @@ class iubenda_Cookie_Law_Solution {
690
  // multilang support
691
  if ( $this->multilang && ! empty( $this->languages ) ) {
692
  foreach ( $this->languages as $lang_id => $lang_name ) {
693
- $input['code_' . $lang_id] = ! empty( $input['code_' . $lang_id] ) ? wp_kses( $input['code_' . $lang_id], array( 'style' => array( 'type' => array() ), 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) : '';
694
 
695
  // handle default lang too
696
  if ( $lang_id == $this->lang_default ) {
697
- $input['code_default'] = ! empty( $input['code_' . $lang_id] ) ? wp_kses( $input['code_' . $lang_id], array( 'style' => array( 'type' => array() ), 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) : $this->options['code_default'];
698
  }
699
  }
700
  } else {
701
- $input['code_default'] = ! empty( $input['code_default'] ) ? wp_kses( $input['code_default'], array( 'style' => array( 'type' => array() ), 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) : '';
702
  }
703
 
704
  add_settings_error( 'iub_settings_errors', 'iub_settings_updated', __( 'Settings saved.', 'iubenda-cookie-law-solution' ), 'updated' );
@@ -717,6 +717,39 @@ class iubenda_Cookie_Law_Solution {
717
 
718
  return $input;
719
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
 
721
  /**
722
  * Load admin options page.
3
  Plugin Name: iubenda Cookie Solution for GDPR
4
  Plugin URI: https://www.iubenda.com
5
  Description: iubenda Cookie Solution allows you to make your website GDPR compliant and manage all aspects of cookie law on WP.
6
+ Version: 1.15.1
7
  Author: iubenda
8
  Author URI: https://www.iubenda.com
9
  License: MIT License
35
  * iubenda_Cookie_Law_Solution final class.
36
  *
37
  * @class iubenda_Cookie_Law_Solution
38
+ * @version 1.15.1
39
  */
40
  class iubenda_Cookie_Law_Solution {
41
 
51
  'menu_position' => 'topmenu',
52
  'deactivation' => false
53
  );
54
+ public $version = '1.15.1';
55
  public $no_html = false;
56
  public $links = array();
57
  public $multilang = false;
256
  * @return mixed
257
  */
258
  public function shortcode( $atts, $content = '' ) {
259
+ return '<!--IUB-COOKIE-BLOCK-START-->' . do_shortcode( $content ) . '<!--IUB-COOKIE-BLOCK-END-->';
260
  }
261
 
262
  /**
571
  <div class="contextual-help-tabs-wrap">';
572
  foreach ( $this->languages as $lang_id => $lang_name ) {
573
  // get code for the language
574
+ $code = ! empty( $this->options['code_' . $lang_id] ) ? html_entity_decode( trim( wp_kses( $this->options['code_' . $lang_id], $this->get_allowed_html() ) ) ) : '';
575
  // handle default, if empty
576
+ $code = empty( $code ) && $lang_id == $this->lang_default ? html_entity_decode( trim( wp_kses( $this->options['code_default'], $this->get_allowed_html() ) ) ) : $code;
577
 
578
  echo '
579
  <div id="tab-panel-' . $lang_id . '" class="help-tab-content' . ( $this->lang_default == $lang_id ? ' active' : '' ) . '">
588
  } else {
589
  echo '
590
  <div id="iub_code_default">
591
+ <textarea name="iubenda_cookie_law_solution[code_default]" class="large-text" cols="50" rows="10">' . html_entity_decode( trim( wp_kses( $this->options['code_default'], $this->get_allowed_html() ) ) ) . '</textarea>
592
  <p class="description">' . __( 'Enter the iubenda code.', 'iubenda-cookie-law-solution' ) . '</p>
593
  </div>';
594
  }
690
  // multilang support
691
  if ( $this->multilang && ! empty( $this->languages ) ) {
692
  foreach ( $this->languages as $lang_id => $lang_name ) {
693
+ $input['code_' . $lang_id] = ! empty( $input['code_' . $lang_id] ) ? wp_kses( $input['code_' . $lang_id], $this->get_allowed_html() ) : '';
694
 
695
  // handle default lang too
696
  if ( $lang_id == $this->lang_default ) {
697
+ $input['code_default'] = ! empty( $input['code_' . $lang_id] ) ? wp_kses( $input['code_' . $lang_id], $this->get_allowed_html() ) : $this->options['code_default'];
698
  }
699
  }
700
  } else {
701
+ $input['code_default'] = ! empty( $input['code_default'] ) ? wp_kses( $input['code_default'], $this->get_allowed_html() ) : '';
702
  }
703
 
704
  add_settings_error( 'iub_settings_errors', 'iub_settings_updated', __( 'Settings saved.', 'iubenda-cookie-law-solution' ), 'updated' );
717
 
718
  return $input;
719
  }
720
+
721
+ /**
722
+ * Get allowed iubenda script HTML.
723
+ *
724
+ * @return array
725
+ */
726
+ public function get_allowed_html() {
727
+ return apply_filters(
728
+ 'iub_code_allowed_html',
729
+ array_merge(
730
+ wp_kses_allowed_html( 'post' ),
731
+ array(
732
+ 'script' => array(
733
+ 'type' => array(),
734
+ 'src' => array(),
735
+ 'charset' => array(),
736
+ 'async' => array()
737
+ ),
738
+ 'noscript' => array(),
739
+ 'style' => array(
740
+ 'type' => array()
741
+ ),
742
+ 'iframe' => array(
743
+ 'src' => array(),
744
+ 'height' => array(),
745
+ 'width' => array(),
746
+ 'frameborder' => array(),
747
+ 'allowfullscreen' => array()
748
+ )
749
+ )
750
+ )
751
+ );
752
+ }
753
 
754
  /**
755
  * Load admin options page.
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: iubenda
3
  Donate link:
4
  Tags: cookies, cookie law, cookie policy, cookie banner, cookie block, privacy policy, cookie consent, privacy
5
  Requires at least: 4.0
6
- Requires PHP: 5.2
7
  Tested up to: 4.9.6
8
- Stable tag: 1.15.0
9
  License: MIT License
10
  License URI: http://opensource.org/licenses/MIT
11
 
@@ -113,6 +113,10 @@ We will be very happy to receive feedback here: [Uservoice forum](http://support
113
 
114
  == Changelog ==
115
 
 
 
 
 
116
  = 1.15.0 =
117
  * New: Option to select iubenda menu position
118
  * Tweak: iubenda faster class regex update
@@ -297,7 +301,6 @@ We will be very happy to receive feedback here: [Uservoice forum](http://support
297
 
298
  == Upgrade Notice ==
299
 
300
- = 1.15.0 =
301
- * New: Option to select iubenda menu position
302
- * Tweak: iubenda faster class regex update
303
- * Tweak: Changed default parser method
3
  Donate link:
4
  Tags: cookies, cookie law, cookie policy, cookie banner, cookie block, privacy policy, cookie consent, privacy
5
  Requires at least: 4.0
6
+ Requires PHP: 5.2.4
7
  Tested up to: 4.9.6
8
+ Stable tag: 1.15.1
9
  License: MIT License
10
  License URI: http://opensource.org/licenses/MIT
11
 
113
 
114
  == Changelog ==
115
 
116
+ = 1.15.1 =
117
+ * Fix: iubenda code field removing HTML tags on save
118
+ * Tweak: Adjusted the script blocking regex in shortcode
119
+
120
  = 1.15.0 =
121
  * New: Option to select iubenda menu position
122
  * Tweak: iubenda faster class regex update
301
 
302
  == Upgrade Notice ==
303
 
304
+ = 1.15.1 =
305
+ * Fix: iubenda code field removing HTML tags on save
306
+ * Tweak: Adjusted the script blocking regex in shortcode