X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconfig.php;h=44606e329acdab68e79cf1c9b309141259f991ec;hb=4c3e9fde288130259ec3729b310551511c1c8f13;hp=df1070c13c6b61ab5c476e5874c619a229a85f7c;hpb=7f19d39b146844fd71d148690d3e550df9d3043b;p=friendica.git diff --git a/include/config.php b/include/config.php index df1070c13c..44606e329a 100644 --- a/include/config.php +++ b/include/config.php @@ -18,19 +18,17 @@ if(! function_exists('load_config')) { function load_config($family) { global $a; - $r = q("SELECT * FROM `config` WHERE `cat` = '%s'", - dbesc($family) - ); + $r = q("SELECT * FROM `config` WHERE `cat` = '%s'", dbesc($family)); if(count($r)) { foreach($r as $rr) { $k = $rr['k']; - if ($rr['cat'] === 'config') { + if ($family === 'config') { $a->config[$k] = $rr['v']; } else { $a->config[$family][$k] = $rr['v']; } } - } else if ($rr['cat'] != 'config') { + } else if ($family != 'config') { // Negative caching $a->config[$family] = "!!"; } @@ -70,7 +68,7 @@ function get_config($family, $key, $instore = false) { ); if(count($ret)) { // manage array value - $val = (preg_match("|^a:[0-9]+:{.*}$|", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); + $val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); $a->config[$family][$key] = $val; return $val; } @@ -128,7 +126,7 @@ function load_pconfig($uid,$family) { $k = $rr['k']; $a->config[$uid][$family][$k] = $rr['v']; } - } else if ($rr['cat'] != 'config') { + } else if ($family != 'config') { // Negative caching $a->config[$uid][$family] = "!!"; } @@ -164,7 +162,7 @@ function get_pconfig($uid,$family, $key, $instore = false) { ); if(count($ret)) { - $val = (preg_match("|^a:[0-9]+:{.*}$|", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); + $val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); $a->config[$uid][$family][$key] = $val; return $val; }