Skip to content

Commit 42bd203

Browse files
committed
Fatal error when passing null to an option section. Why would anyone do that?? Ver bump.
Signed-off-by: Kevin Provance <[email protected]>
1 parent 6ddeec9 commit 42bd203

File tree

6 files changed

+21
-13
lines changed

6 files changed

+21
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Redux Changelog
22

3+
## 4.2.6
4+
* Fixed: Fatal error if passing null as an option section.
5+
36
## 4.2.5
4-
* Fixed: Type mismatch in Redux Helpers.
7+
* Fixed: Return type mismatch in Redux Helpers.
58

69
## 4.2.4
710
* Fixed: Taxonomy WordPress data not handled properly in fields that support WordPress data.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"main": "gulpfile.js",
44
"name": "redux",
55
"author": "Redux.io",
6-
"version": "4.2.5",
6+
"version": "4.2.6",
77
"license": "GPL-3.0-or-later",
88
"repository": {
99
"type": "git",

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: gutenberg, blocks, gutenberg blocks, editor, block, page builder, block ed
44
Requires at least: 4.0
55
Requires PHP: 7.1
66
Tested up to: 5.8
7-
Stable tag: 4.2.5
7+
Stable tag: 4.2.6
88
License: GPL-3.0+
99
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
1010

@@ -152,6 +152,9 @@ If you want, you can use the [Gutenberg](https://wordpress.org/plugins/gutenberg
152152

153153
== Changelog ==
154154

155+
= 4.2.6 =
156+
Fixed: Fatal error if passing null as an option section.
157+
155158
= 4.2.5 =
156159
Fixed: Type mismatch in Redux Helpers.
157160

redux-core/framework.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
require_once dirname( __FILE__ ) . '/class-redux-core.php';
2525

26-
Redux_Core::$version = '4.2.5';
26+
Redux_Core::$version = '4.2.6';
2727
Redux_Core::$redux_path = dirname( __FILE__ );
2828
Redux_Core::instance();
2929

redux-core/inc/classes/class-redux-api.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,9 @@ public static function set_sections( string $opt_name = '', array $sections = ar
565565
Redux_Functions_Ex::record_caller( $opt_name );
566566

567567
foreach ( $sections as $section ) {
568-
self::set_section( $opt_name, $section );
568+
if ( isset( $section ) && ! empty( $section ) ) {
569+
self::set_section( $opt_name, $section );
570+
}
569571
}
570572
}
571573

@@ -658,12 +660,12 @@ public static function remove_section( string $opt_name = '', string $id = '', b
658660
/**
659661
* Deprecated Sets a single option panel section.
660662
*
661-
* @param string $opt_name Panel opt_name.
662-
* @param array $section Section data.
663+
* @param string $opt_name Panel opt_name.
664+
* @param array|null $section Section data.
663665
*
664666
* @deprecated No longer using camelCase naming convention.
665667
*/
666-
public static function setSection( string $opt_name = '', array $section = array() ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName
668+
public static function setSection( string $opt_name = '', ?array $section = array() ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName
667669
if ( '' !== $opt_name ) {
668670
Redux_Functions_Ex::record_caller( $opt_name );
669671
}
@@ -674,11 +676,11 @@ public static function setSection( string $opt_name = '', array $section = array
674676
/**
675677
* Sets a single option panel section.
676678
*
677-
* @param string $opt_name Panel opt_name.
678-
* @param array $section Section data.
679-
* @param bool $replace Replaces section instead of creating a new one.
679+
* @param string $opt_name Panel opt_name.
680+
* @param array|null $section Section data.
681+
* @param bool $replace Replaces section instead of creating a new one.
680682
*/
681-
public static function set_section( string $opt_name = '', array $section = array(), bool $replace = false ) {
683+
public static function set_section( string $opt_name = '', ?array $section = array(), bool $replace = false ) {
682684
if ( empty( $section ) || '' === $opt_name ) {
683685
return;
684686
}

redux-framework.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Description: Build better sites in WordPress fast
1111
* Author: Redux.io
1212
* Author URI: http://redux.io
13-
* Version: 4.2.5
13+
* Version: 4.2.6
1414
* Text Domain: redux-framework
1515
* License: GPLv3 or later
1616
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt

0 commit comments

Comments
 (0)