diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-06-24 11:25:20 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-06-24 11:25:20 +0200 |
commit | c8ae04a96a38b7351c2ac506c836bb9b1734d58e (patch) | |
tree | b15646cc7746f8b18dc844a9d7c8836c29bc7896 /Zotlabs/Lib/AbConfig.php | |
parent | 39b14b6b811ec65f8c8a812397f9ee04877cd53d (diff) | |
parent | c809b6f95e0c9717cba9cfad62b74104fbcc878d (diff) | |
download | volse-hubzilla-c8ae04a96a38b7351c2ac506c836bb9b1734d58e.tar.gz volse-hubzilla-c8ae04a96a38b7351c2ac506c836bb9b1734d58e.tar.bz2 volse-hubzilla-c8ae04a96a38b7351c2ac506c836bb9b1734d58e.zip |
Merge branch 'dev' into sabre32
Diffstat (limited to 'Zotlabs/Lib/AbConfig.php')
-rw-r--r-- | Zotlabs/Lib/AbConfig.php | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Zotlabs/Lib/AbConfig.php b/Zotlabs/Lib/AbConfig.php index f2d6522b9..138d0dfea 100644 --- a/Zotlabs/Lib/AbConfig.php +++ b/Zotlabs/Lib/AbConfig.php @@ -5,18 +5,18 @@ namespace Zotlabs\Lib; class AbConfig { - static public function Load($chash,$xhash) { - $r = q("select * from abconfig where chan = '%s' and xchan = '%s'", - dbesc($chash), + static public function Load($chan,$xhash) { + $r = q("select * from abconfig where chan = %d and xchan = '%s'", + intval($chan), dbesc($xhash) ); return $r; } - static public function Get($chash,$xhash,$family,$key) { - $r = q("select * from abconfig where chan = '%s' and xchan = '%s' and cat = '%s' and k = '%s' limit 1", - dbesc($chash), + static public function Get($chan,$xhash,$family,$key) { + $r = q("select * from abconfig where chan = %d and xchan = '%s' and cat = '%s' and k = '%s' limit 1", + intval($chan), dbesc($xhash), dbesc($family), dbesc($key) @@ -28,14 +28,14 @@ class AbConfig { } - static public function Set($chash,$xhash,$family,$key,$value) { + static public function Set($chan,$xhash,$family,$key,$value) { $dbvalue = ((is_array($value)) ? serialize($value) : $value); $dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue); - if(self::Get($chash,$xhash,$family,$key) === false) { - $r = q("insert into abconfig ( chan, xchan, cat, k, v ) values ( '%s', '%s', '%s', '%s', '%s' ) ", - dbesc($chash), + if(self::Get($chan,$xhash,$family,$key) === false) { + $r = q("insert into abconfig ( chan, xchan, cat, k, v ) values ( %d, '%s', '%s', '%s', '%s' ) ", + intval($chan), dbesc($xhash), dbesc($family), dbesc($key), @@ -43,9 +43,9 @@ class AbConfig { ); } else { - $r = q("update abconfig set v = '%s' where chan = '%s' and xchan = '%s' and cat = '%s' and k = '%s' ", + $r = q("update abconfig set v = '%s' where chan = %d and xchan = '%s' and cat = '%s' and k = '%s' ", dbesc($dbvalue), - dbesc($chash), + dbesc($chan), dbesc($xhash), dbesc($family), dbesc($key) @@ -58,10 +58,10 @@ class AbConfig { } - static public function Delete($chash,$xhash,$family,$key) { + static public function Delete($chan,$xhash,$family,$key) { - $r = q("delete from abconfig where chan = '%s' and xchan = '%s' and cat = '%s' and k = '%s' ", - dbesc($chash), + $r = q("delete from abconfig where chan = %d and xchan = '%s' and cat = '%s' and k = '%s' ", + intval($chan), dbesc($xhash), dbesc($family), dbesc($key) @@ -70,4 +70,4 @@ class AbConfig { return $r; } -}
\ No newline at end of file +} |