]> git.mxchange.org Git - friendica.git/commitdiff
Make sure that we only quit when we are sure we can
authorMichael <heluecht@pirati.ca>
Wed, 1 Feb 2017 08:43:18 +0000 (08:43 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 1 Feb 2017 08:43:18 +0000 (08:43 +0000)
include/socgraph.php

index 312b1b73f978b3f7106b4a19f97fbb4c4c09deef..19b94205ada4b01554f4e224e64ed55549fd6797 100644 (file)
@@ -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;
        }