From 437aa168d136db2c782ed2b366e411721f5f605c Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 17 Oct 2016 21:03:34 -0700 Subject: array_key_exists warning on PConfig::Delete() --- Zotlabs/Lib/PConfig.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Zotlabs/Lib/PConfig.php') diff --git a/Zotlabs/Lib/PConfig.php b/Zotlabs/Lib/PConfig.php index a481667a5..7e29ef8de 100644 --- a/Zotlabs/Lib/PConfig.php +++ b/Zotlabs/Lib/PConfig.php @@ -185,13 +185,16 @@ class PConfig { $ret = false; - if(array_key_exists($key, \App::$config[$uid][$family])) + if(array_key_exists($uid,\App::$config) + && array_key_exists($family,\App::$config['uid']) + && array_key_exists($key, \App::$config[$uid][$family])) unset(\App::$config[$uid][$family][$key]); - $ret = q("DELETE FROM pconfig WHERE uid = %d AND cat = '%s' AND k = '%s'", - intval($uid), - dbesc($family), - dbesc($key) - ); + + $ret = q("DELETE FROM pconfig WHERE uid = %d AND cat = '%s' AND k = '%s'", + intval($uid), + dbesc($family), + dbesc($key) + ); return $ret; } -- cgit v1.2.3