From: Rotem Liss Date: Mon, 18 Aug 2008 14:51:10 +0000 (+0000) Subject: Avoid notices: Before checking if retval is an array, check if it is defined. X-Git-Tag: 1.31.0-rc.0~45833 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=ef48f1f43563d2eccbc238a76f3f83d6a03feaa2;p=lhc%2Fweb%2Fwiklou.git Avoid notices: Before checking if retval is an array, check if it is defined. --- diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index ddaaa589fa..0ed768791c 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -46,7 +46,7 @@ class SiteConfiguration { // Do tag settings foreach ( $wikiTags as $tag ) { if ( array_key_exists( $tag, $thisSetting ) ) { - if ( is_array($retval) && is_array($thisSetting[$tag]) ) { + if ( isset($retval) && is_array($retval) && is_array($thisSetting[$tag]) ) { $retval = array_merge( $retval, $thisSetting[$tag] ); } else { $retval = $thisSetting[$tag]; @@ -61,7 +61,7 @@ class SiteConfiguration { // Do suffix settings if ( array_key_exists( $suffix, $thisSetting ) ) { - if ( is_array($retval) && is_array($thisSetting[$suffix]) ) { + if ( isset($retval) && is_array($retval) && is_array($thisSetting[$suffix]) ) { $retval = array_merge( $retval, $thisSetting[$suffix] ); } else { $retval = $thisSetting[$suffix]; @@ -75,7 +75,7 @@ class SiteConfiguration { // Fall back to default. if ( array_key_exists( 'default', $thisSetting ) ) { - if ( is_array($retval) && is_array($thisSetting['default']) ) { + if ( isset($retval) && is_array($retval) && is_array($thisSetting['default']) ) { $retval = array_merge( $retval, $thisSetting['default'] ); } else { $retval = $thisSetting['default'];