config: fix get_config and get_pconfig search for serialized array

works also if the serialized string contains newlines
pull/451/head
Fabrixxm 2012-08-29 04:19:15 -04:00
parent 9ecb984285
commit f433158bed
1 changed files with 2 additions and 2 deletions

View File

@ -68,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;
}
@ -162,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;
}