From 81bc152cc13f41df8656b856896d77375445e5a7 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Tue, 26 May 2015 17:12:15 +1000 Subject: [PATCH] Check before merging arrays --- includes/admin/settings/class-sp-settings-general.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/admin/settings/class-sp-settings-general.php b/includes/admin/settings/class-sp-settings-general.php index f655a9b6..47366ecd 100644 --- a/includes/admin/settings/class-sp-settings-general.php +++ b/includes/admin/settings/class-sp-settings-general.php @@ -5,7 +5,7 @@ * @author ThemeBoy * @category Admin * @package SportsPress/Admin - * @version 1.8.4 + * @version 1.8.5 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -215,9 +215,12 @@ class SP_Settings_General extends SP_Settings_Page { 'link' => $link, ); - $options = (array) get_option( 'themeboy', array() ); - $options = array_merge( $options, $colors ); - update_option( 'themeboy', $options ); + $options = get_option( 'themeboy', array() ); + if ( is_array( $options ) ) { + $colors = array_merge( $options, $colors ); + } + + update_option( 'themeboy', $colors ); } }