X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconfig.php;h=d138d20534907fc953e917a6d0d43d968ceeb60c;hb=74954e6c68fce7cca5c1fcb5589c7c25a815f474;hp=44606e329acdab68e79cf1c9b309141259f991ec;hpb=234598280d96627861a1ff1dcfc8a4a59bd37054;p=friendica.git diff --git a/include/config.php b/include/config.php index 44606e329a..d138d20534 100644 --- a/include/config.php +++ b/include/config.php @@ -85,6 +85,15 @@ function get_config($family, $key, $instore = false) { if(! function_exists('set_config')) { function set_config($family,$key,$value) { global $a; + + // If $a->config[$family] has been previously set to '!!', then + // $a->config[$family][$key] will evaluate to $a->config[$family][0], and + // $a->config[$family][$key] = $value will be equivalent to + // $a->config[$family][0] = $value[0] (this causes infuriating bugs), + // so unset the family before assigning a value to a family's key + if($a->config[$family] === '!!') + unset($a->config[$family]); + // manage array value $dbvalue = (is_array($value)?serialize($value):$value); $dbvalue = (is_bool($dbvalue) ? intval($dbvalue) : $dbvalue);