From c75d6ad850b0106994269fa203a884e1b89eee9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 14 Dec 2016 12:03:02 +0100 Subject: [PATCH] More dbm::is_result() instead of count() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- include/Core/Config.php | 2 +- include/Core/PConfig.php | 2 +- include/salmon.php | 2 +- mod/dfrn_confirm.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/Core/Config.php b/include/Core/Config.php index 7b7045a9ee..5235728864 100644 --- a/include/Core/Config.php +++ b/include/Core/Config.php @@ -97,7 +97,7 @@ class Config { dbesc($family), dbesc($key) ); - if (count($ret)) { + if (dbm::is_result($ret)) { // manage array value $val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); $a->config[$family][$key] = $val; diff --git a/include/Core/PConfig.php b/include/Core/PConfig.php index 43735018e4..49b69a1f7a 100644 --- a/include/Core/PConfig.php +++ b/include/Core/PConfig.php @@ -92,7 +92,7 @@ class PConfig { dbesc($key) ); - if (count($ret)) { + if (dbm::is_result($ret)) { $val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); $a->config[$uid][$family][$key] = $val; diff --git a/include/salmon.php b/include/salmon.php index 5e9c4fa616..c5c3d72237 100644 --- a/include/salmon.php +++ b/include/salmon.php @@ -24,7 +24,7 @@ function get_salmon_key($uri,$keyhash) { // We have found at least one key URL // If it's inline, parse it - otherwise get the key - if(count($ret)) { + if(count($ret) > 0) { for($x = 0; $x < count($ret); $x ++) { if(substr($ret[$x],0,5) === 'data:') { if(strstr($ret[$x],',')) diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 23c62cb0ab..df663f7cd4 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -584,7 +584,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { dbesc($decrypted_source_url), intval($local_uid) ); - if(! count($ret)) { + if(! dbm::is_result($ret)) { if(strstr($decrypted_source_url,'http:')) $newurl = str_replace('http:','https:',$decrypted_source_url); else @@ -594,7 +594,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { dbesc($newurl), intval($local_uid) ); - if(! count($ret)) { + if(! dbm::is_result($ret)) { // this is either a bogus confirmation (?) or we deleted the original introduction. $message = t('Contact record was not found for you on our site.'); xml_status(3,$message); -- 2.39.5