From 2bcbf87bb955c397d25c073ed1809b81c6b3a1d2 Mon Sep 17 00:00:00 2001 From: CGlingener Date: Mon, 24 Nov 2014 13:28:38 +0100 Subject: [PATCH] Fixed PHP Warnings: Illegal offset string Warning: Illegal string offset 'SECTION_ID' in /plugins/redux-framework/ReduxCore/framework.php on line 3057 Warning: Illegal offset string 'id' in /plugins/redux-framework/ReduxCore/framework.php on line 3081 Header already sent... --- ReduxCore/framework.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ReduxCore/framework.php b/ReduxCore/framework.php index 54fe867cb..fa7dd1361 100644 --- a/ReduxCore/framework.php +++ b/ReduxCore/framework.php @@ -3054,7 +3054,11 @@ public function _validate_values( $plugin_options, $options, $sections ) { foreach ( $sections as $k => $section ) { if ( isset( $section['fields'] ) ) { foreach ( $section['fields'] as $fkey => $field ) { - $field['section_id'] = $k; + + if( is_array( $field ) ) { + $field['section_id'] = $k; + } + if ( isset( $field['type'] ) && ( $field['type'] == 'checkbox' || $field['type'] == 'checkbox_hide_below' || $field['type'] == 'checkbox_hide_all' ) ) { if ( ! isset( $plugin_options[ $field['id'] ] ) ) { @@ -3078,7 +3082,7 @@ public function _validate_values( $plugin_options, $options, $sections ) { // Check for empty id value - if ( ! isset( $plugin_options[ $field['id'] ] ) || ( isset( $plugin_options[ $field['id'] ] ) && $plugin_options[ $field['id'] ] == '' ) ) { + if ( ! isset( $field['id'] ) || ! isset( $plugin_options[ $field['id'] ] ) || ( isset( $plugin_options[ $field['id'] ] ) && $plugin_options[ $field['id'] ] == '' ) ) { // If we are looking for an empty value, in the case of 'not_empty' // then we need to keep processing.