Skip to content

Commit

Permalink
Merge pull request #30 from brainstormforce/bug-fix
Browse files Browse the repository at this point in the history
Prevent bypass for AJAX nonce check
  • Loading branch information
patilvikasj authored Aug 25, 2020
2 parents 9de4975 + 6fd96b1 commit 9df6f11
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Tags:** custom sidebar, sidebar manager, custom widget areas, widgets, conditional sidebar
**Requires at least:** 4.0
**Tested up to:** 5.5
**Stable tag:** 1.1.4
**Stable tag:** 1.1.5
**License:** GPLv2 or later
**License URI:** https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -51,6 +51,9 @@ Other plugins we found are heavy with ugly interface, non supported, developed o

## Changelog ##

### 1.1.5 ###
- Fix: Security hardening.

### 1.1.4 ###
- Fix: Fixed compatibility with other plugins with respect to the admin notice.

Expand Down
6 changes: 5 additions & 1 deletion classes/class-bsf-sb-metabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ public function metabox_actions() {
*/
public function metabox_save( $post_id ) {

if( ! isset( $_POST[ BSF_SB_POST_TYPE . '-nonce' ] ) ) {
return;
}

if ( get_post_type() != BSF_SB_POST_TYPE
|| ( isset( $_POST[ BSF_SB_POST_TYPE . '-nonce' ] ) && ! wp_verify_nonce( $_POST[ BSF_SB_POST_TYPE . '-nonce' ], BSF_SB_POST_TYPE ) )
|| ! wp_verify_nonce( $_POST[ BSF_SB_POST_TYPE . '-nonce' ], BSF_SB_POST_TYPE )
) {
return $post_id;
}
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/BrainstormForce
Tags: custom sidebar, sidebar manager, custom widget areas, widgets, conditional sidebar
Requires at least: 4.0
Tested up to: 5.5
Stable tag: 1.1.4
Stable tag: 1.1.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -51,6 +51,9 @@ Other plugins we found are heavy with ugly interface, non supported, developed o

== Changelog ==

= 1.1.5 =
- Fix: Security hardening.

= 1.1.4 =
- Fix: Fixed compatibility with other plugins with respect to the admin notice.

Expand Down
4 changes: 2 additions & 2 deletions sidebar-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Sidebar Manager
* Plugin URI: http://www.brainstormforce.com
* Description: This is the plugin to create custom siderbars to your site.
* Version: 1.1.4
* Version: 1.1.5
* Author: Brainstorm Force
* Author URI: https://www.brainstormforce.com/
* Text Domain: bsfsidebars
Expand All @@ -25,7 +25,7 @@
define( 'BSF_SB_BASE', plugin_basename( BSF_SB_FILE ) );
define( 'BSF_SB_DIR', plugin_dir_path( BSF_SB_FILE ) );
define( 'BSF_SB_URL', plugins_url( '/', BSF_SB_FILE ) );
define( 'BSF_SB_VER', '1.1.4' );
define( 'BSF_SB_VER', '1.1.5' );
define( 'BSF_SB_PREFIX', 'bsf-sb' );
define( 'BSF_SB_POST_TYPE', 'bsf-sidebar' );

Expand Down

0 comments on commit 9df6f11

Please sign in to comment.