From 7a89d06465a69ad211aabdd5e2778506a7b2f81e Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 1 Feb 2017 08:43:18 +0000 Subject: [PATCH] Make sure that we only quit when we are sure we can --- include/socgraph.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/socgraph.php b/include/socgraph.php index 312b1b73f9..19b94205ad 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -690,7 +690,7 @@ function poco_check_server($server_url, $network = "", $force = false) { return false; $servers = q("SELECT * FROM `gserver` WHERE `nurl` = '%s'", dbesc(normalise_link($server_url))); - if ($servers) { + if (dbm::is_result($servers)) { if ($servers[0]["created"] == "0000-00-00 00:00:00") q("UPDATE `gserver` SET `created` = '%s' WHERE `nurl` = '%s'", @@ -740,7 +740,8 @@ function poco_check_server($server_url, $network = "", $force = false) { // Quit if there is a timeout. // But we want to make sure to only quit if we are mostly sure that this server url fits. - if (($orig_server_url == $server_url) AND ($serverret['errno'] == CURLE_OPERATION_TIMEDOUT)) { + if (dbm::is_result($servers) AND ($orig_server_url == $server_url) AND + ($serverret['errno'] == CURLE_OPERATION_TIMEDOUT)) { logger("Connection to server ".$server_url." timed out.", LOGGER_DEBUG); return false; }