diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-07-30 06:30:46 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-07-30 06:30:46 -0400 |
commit | f17f51a9c1f62dc0229e2428cacea4e84313560e (patch) | |
tree | 7486b05738e943bf39619d06bec9d83d7795e746 /Zotlabs/Lib/PConfig.php | |
parent | 5a63ddd6457ae4dba61ff30db5b6601b22ddd1b6 (diff) | |
parent | d858bd9265a4a0fa3589cdb2126031998310c7c3 (diff) | |
download | volse-hubzilla-f17f51a9c1f62dc0229e2428cacea4e84313560e.tar.gz volse-hubzilla-f17f51a9c1f62dc0229e2428cacea4e84313560e.tar.bz2 volse-hubzilla-f17f51a9c1f62dc0229e2428cacea4e84313560e.zip |
Merge remote-tracking branch 'upstream/dev' into website-import
Diffstat (limited to 'Zotlabs/Lib/PConfig.php')
-rw-r--r-- | Zotlabs/Lib/PConfig.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Zotlabs/Lib/PConfig.php b/Zotlabs/Lib/PConfig.php index 195321375..a481667a5 100644 --- a/Zotlabs/Lib/PConfig.php +++ b/Zotlabs/Lib/PConfig.php @@ -17,12 +17,20 @@ class PConfig { */ static public function Load($uid) { - if($uid === false) + if(is_null($uid) || $uid === false) return false; if(! array_key_exists($uid, \App::$config)) \App::$config[$uid] = array(); + if(! is_array(\App::$config)) { + btlogger('App::$config not an array: ' . $uid); + } + + if(! is_array(\App::$config[$uid])) { + btlogger('App::$config[$uid] not an array: ' . $uid); + } + $r = q("SELECT * FROM pconfig WHERE uid = %d", intval($uid) ); @@ -61,7 +69,7 @@ class PConfig { static public function Get($uid,$family,$key,$instore = false) { - if($uid === false) + if(is_null($uid) || $uid === false) return false; if(! array_key_exists($uid, \App::$config)) @@ -102,7 +110,7 @@ class PConfig { // we provide a function backtrace in the logs so that we can find // and fix the calling function. - if($uid === false) { + if(is_null($uid) || $uid === false) { btlogger('UID is FALSE!', LOGGER_NORMAL, LOG_ERR); return; } @@ -172,6 +180,9 @@ class PConfig { static public function Delete($uid, $family, $key) { + if(is_null($uid) || $uid === false) + return false; + $ret = false; if(array_key_exists($key, \App::$config[$uid][$family])) |