From 8879776d6436ed5257648a1873ddaa9486b25070 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 23 Oct 2022 14:02:19 +0200 Subject: fix php warnings --- Zotlabs/Lib/AbConfig.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'Zotlabs/Lib/AbConfig.php') diff --git a/Zotlabs/Lib/AbConfig.php b/Zotlabs/Lib/AbConfig.php index dfc9efc6c..af1786966 100644 --- a/Zotlabs/Lib/AbConfig.php +++ b/Zotlabs/Lib/AbConfig.php @@ -6,12 +6,17 @@ namespace Zotlabs\Lib; class AbConfig { static public function Load($chan,$xhash,$family = '') { - if($family) + $where = ''; + + if($family) { $where = sprintf(" and cat = '%s' ",dbesc($family)); + } + $r = q("select * from abconfig where chan = %d and xchan = '%s' $where", intval($chan), dbesc($xhash) ); + return $r; } @@ -21,7 +26,7 @@ class AbConfig { intval($chan), dbesc($xhash), dbesc($family), - dbesc($key) + dbesc($key) ); if($r) { return ((preg_match('|^a:[0-9]+:{.*}$|s', $r[0]['v'])) ? unserialize($r[0]['v']) : $r[0]['v']); @@ -41,19 +46,19 @@ class AbConfig { dbesc($xhash), dbesc($family), dbesc($key), - dbesc($dbvalue) + dbesc($dbvalue) ); } else { $r = q("update abconfig set v = '%s' where chan = %d and xchan = '%s' and cat = '%s' and k = '%s' ", - dbesc($dbvalue), + dbesc($dbvalue), dbesc($chan), dbesc($xhash), dbesc($family), dbesc($key) ); } - + if($r) return $value; return false; -- cgit v1.2.3