aboutsummaryrefslogtreecommitdiffstats
path: root/include/config.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-01 20:07:47 -0800
committerfriendica <info@friendica.com>2014-02-01 20:07:47 -0800
commit2c75210fdbb316d13ad27950b14302266fff9a8e (patch)
tree586065a23405c2c26d61566e7ab8b51c98fa991c /include/config.php
parent94e59d47705f30cab039c01e2ba2bc079496938e (diff)
downloadvolse-hubzilla-2c75210fdbb316d13ad27950b14302266fff9a8e.tar.gz
volse-hubzilla-2c75210fdbb316d13ad27950b14302266fff9a8e.tar.bz2
volse-hubzilla-2c75210fdbb316d13ad27950b14302266fff9a8e.zip
config: don't try to unserialise an array
Diffstat (limited to 'include/config.php')
-rw-r--r--include/config.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/config.php b/include/config.php
index bccf0737f..8d98d56fa 100644
--- a/include/config.php
+++ b/include/config.php
@@ -65,7 +65,7 @@ function get_config($family, $key) {
if(! array_key_exists($key,$a->config[$family])) {
return false;
}
- return ((preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$family][$key]))
+ return ((! is_array($a->config[$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$family][$key]))
? unserialize($a->config[$family][$key])
: $a->config[$family][$key]
);
@@ -174,8 +174,8 @@ function get_pconfig($uid,$family, $key, $instore = false) {
if((! array_key_exists($family,$a->config[$uid])) || (! array_key_exists($key,$a->config[$uid][$family])))
return false;
-
- return ((preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$uid][$family][$key]))
+
+ return ((! is_array($a->config[$uid][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$uid][$family][$key]))
? unserialize($a->config[$uid][$family][$key])
: $a->config[$uid][$family][$key]
);
@@ -304,7 +304,7 @@ function get_xconfig($xchan,$family, $key) {
if((! array_key_exists($family,$a->config[$xchan])) || (! array_key_exists($key,$a->config[$xchan][$family])))
return false;
- return ((preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$xchan][$family][$key]))
+ return ((! is_array($a->config[$xchan][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$xchan][$family][$key]))
? unserialize($a->config[$xchan][$family][$key])
: $a->config[$xchan][$family][$key]
);