]> git.mxchange.org Git - friendica.git/commitdiff
config: fix get_config and get_pconfig search for serialized array
authorFabrixxm <fabrix.xm@gmail.com>
Wed, 29 Aug 2012 08:19:15 +0000 (04:19 -0400)
committerFabrixxm <fabrix.xm@gmail.com>
Wed, 29 Aug 2012 08:19:15 +0000 (04:19 -0400)
works also if the serialized string contains newlines

include/config.php

index 1f2a70e5a144bc4529523bd104b1428646b1c29b..44606e329acdab68e79cf1c9b309141259f991ec 100644 (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;
        }