Widget Logic - Version 5.10.3

Version Description

  • Security update. Huge thanks to the Plugin Vulnerabilities Team!
Download this release

Release Info

Developer wpchefgadget
Plugin Icon 128x128 Widget Logic
Version 5.10.3
Comparing to
See all releases

Code changes from version 5.10.2 to 5.10.3

Files changed (2) hide show
  1. readme.txt +5 -1
  2. widget_logic.php +9 -5
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wpchefgadget
3
  Tags: widget, sidebar, content, conditional tags, toggle
4
  Requires at least: 3.0
5
  Tested up to: 5.2.2
6
- Stable tag: 5.10.2
7
 
8
  Widget Logic lets you control on which pages widgets appear using WP's conditional tags.
9
 
@@ -101,6 +101,10 @@ Tighten up your definitions with PHPs 'logical AND' &&, for example:
101
 
102
  == Changelog ==
103
 
 
 
 
 
104
  = 5.10.2 =
105
 
106
  * The plugin's security has been improved, big thanks to [Paul Dannewitz](https://dannewitz.ninja/) for his excellent security audit!
3
  Tags: widget, sidebar, content, conditional tags, toggle
4
  Requires at least: 3.0
5
  Tested up to: 5.2.2
6
+ Stable tag: 5.10.3
7
 
8
  Widget Logic lets you control on which pages widgets appear using WP's conditional tags.
9
 
101
 
102
  == Changelog ==
103
 
104
+ = 5.10.3 =
105
+
106
+ * Security update. Huge thanks to the [Plugin Vulnerabilities](https://www.pluginvulnerabilities.com/) Team!
107
+
108
  = 5.10.2 =
109
 
110
  * The plugin's security has been improved, big thanks to [Paul Dannewitz](https://dannewitz.ninja/) for his excellent security audit!
widget_logic.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Widget Logic
4
  Author URI: https://wpchef.org
5
  Description: Control widgets with WP's conditional tags is_home etc
6
- Version: 5.10.2
7
  Author: WPChef
8
  Text Domain: widget-logic
9
  */
@@ -103,7 +103,7 @@ function widget_logic_expand_control()
103
 
104
 
105
  // IMPORT ALL OPTIONS
106
- if ( isset($_POST['wl-options-import']))
107
  { if ($_FILES['wl-options-import-file']['tmp_name'])
108
  { $import=explode("\n",file_get_contents($_FILES['wl-options-import-file']['tmp_name'], false));
109
  if (array_shift($import)=="[START=WIDGET LOGIC OPTIONS]" && array_pop($import)=="[STOP=WIDGET LOGIC OPTIONS]")
@@ -128,7 +128,7 @@ function widget_logic_expand_control()
128
 
129
  // UPDATE OTHER WIDGET LOGIC OPTIONS
130
  // must update this to use http://codex.wordpress.org/Settings_API
131
- if ( isset($_POST['widget_logic-options-submit']) )
132
  {
133
  if ( !empty($_POST['widget_logic-options-filter']) )
134
  $wl_options['widget_logic-options-filter'] = true;
@@ -136,7 +136,7 @@ function widget_logic_expand_control()
136
  unset( $wl_options['widget_logic-options-filter'] );
137
  $wl_options['widget_logic-options-wp_reset_query'] = !empty($_POST['widget_logic-options-wp_reset_query']);
138
  $wl_options['widget_logic-options-show_errors'] = !empty($_POST['widget_logic-options-show_errors']);
139
- $wl_options['widget_logic-options-load_point']=$_POST['widget_logic-options-load_point'];
140
  }
141
 
142
 
@@ -206,6 +206,8 @@ function widget_logic_options_control()
206
  <?php esc_html_e('Display logic errors to admin', 'widget-logic'); ?>
207
  </label>
208
  </ul>
 
 
209
  <?php submit_button( __( 'Save WL options', 'widget-logic' ), 'button-primary', 'widget_logic-options-submit', false ); ?>
210
 
211
  </form>
@@ -213,7 +215,9 @@ function widget_logic_options_control()
213
  <a class="submit button" href="?wl-options-export" title="<?php _e('Save all WL options to a plain text config file', 'widget-logic'); ?>"><?php _e('Export options', 'widget-logic'); ?></a><p>
214
  <?php submit_button( __( 'Import options', 'widget-logic' ), 'button', 'wl-options-import', false, array('title'=> __( 'Load all WL options from a plain text config file', 'widget-logic' ) ) ); ?>
215
  <input type="file" name="wl-options-import-file" id="wl-options-import-file" title="<?php _e('Select file for importing', 'widget-logic'); ?>" /></p>
216
- </form>
 
 
217
 
218
  </div>
219
 
3
  Plugin Name: Widget Logic
4
  Author URI: https://wpchef.org
5
  Description: Control widgets with WP's conditional tags is_home etc
6
+ Version: 5.10.3
7
  Author: WPChef
8
  Text Domain: widget-logic
9
  */
103
 
104
 
105
  // IMPORT ALL OPTIONS
106
+ if ( isset($_POST['wl-options-import']) && current_user_can('administrator') && isset( $_POST['widget_logic_nonce'] ) && wp_verify_nonce( $_POST['widget_logic_nonce'], 'widget_logic_import'))
107
  { if ($_FILES['wl-options-import-file']['tmp_name'])
108
  { $import=explode("\n",file_get_contents($_FILES['wl-options-import-file']['tmp_name'], false));
109
  if (array_shift($import)=="[START=WIDGET LOGIC OPTIONS]" && array_pop($import)=="[STOP=WIDGET LOGIC OPTIONS]")
128
 
129
  // UPDATE OTHER WIDGET LOGIC OPTIONS
130
  // must update this to use http://codex.wordpress.org/Settings_API
131
+ if ( isset($_POST['widget_logic-options-submit']) && current_user_can('administrator') && isset( $_POST['widget_logic_nonce'] ) && wp_verify_nonce( $_POST['widget_logic_nonce'], 'widget_logic_settings') )
132
  {
133
  if ( !empty($_POST['widget_logic-options-filter']) )
134
  $wl_options['widget_logic-options-filter'] = true;
136
  unset( $wl_options['widget_logic-options-filter'] );
137
  $wl_options['widget_logic-options-wp_reset_query'] = !empty($_POST['widget_logic-options-wp_reset_query']);
138
  $wl_options['widget_logic-options-show_errors'] = !empty($_POST['widget_logic-options-show_errors']);
139
+ $wl_options['widget_logic-options-load_point'] = sanitize_text_field($_POST['widget_logic-options-load_point']);
140
  }
141
 
142
 
206
  <?php esc_html_e('Display logic errors to admin', 'widget-logic'); ?>
207
  </label>
208
  </ul>
209
+
210
+ <?php wp_nonce_field( 'widget_logic_settings', 'widget_logic_nonce' ); ?>
211
  <?php submit_button( __( 'Save WL options', 'widget-logic' ), 'button-primary', 'widget_logic-options-submit', false ); ?>
212
 
213
  </form>
215
  <a class="submit button" href="?wl-options-export" title="<?php _e('Save all WL options to a plain text config file', 'widget-logic'); ?>"><?php _e('Export options', 'widget-logic'); ?></a><p>
216
  <?php submit_button( __( 'Import options', 'widget-logic' ), 'button', 'wl-options-import', false, array('title'=> __( 'Load all WL options from a plain text config file', 'widget-logic' ) ) ); ?>
217
  <input type="file" name="wl-options-import-file" id="wl-options-import-file" title="<?php _e('Select file for importing', 'widget-logic'); ?>" /></p>
218
+
219
+ <?php wp_nonce_field( 'widget_logic_import', 'widget_logic_nonce' ); ?>
220
+ </form>
221
 
222
  </div>
223