]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #5199 from MrPetovan/bug/4971-fix-php72-notice-portablecontact
authorMichael Vogel <icarus@dabo.de>
Wed, 13 Jun 2018 05:16:58 +0000 (07:16 +0200)
committerGitHub <noreply@github.com>
Wed, 13 Jun 2018 05:16:58 +0000 (07:16 +0200)
Fix PHP 7.2 sizeof notice messages in Protocol\PortableContact

src/Protocol/PortableContact.php

index 4eaf5bbb6c74c76e4eda74763a6478f42f16831f..2dcc0474062978c013ad0f567e3ff8b90aa72f0d 100644 (file)
@@ -1009,7 +1009,7 @@ class PortableContact
 
                // Maybe the page is unencrypted only?
                $xmlobj = @simplexml_load_string($serverret["body"], 'SimpleXMLElement', 0, "http://docs.oasis-open.org/ns/xri/xrd-1.0");
-               if (!$serverret["success"] || ($serverret["body"] == "") || (@sizeof($xmlobj) == 0) || !is_object($xmlobj)) {
+               if (!$serverret["success"] || ($serverret["body"] == "") || (empty($xmlobj) == 0) || !is_object($xmlobj)) {
                        $server_url = str_replace("https://", "http://", $server_url);
 
                        // We set the timeout to 20 seconds since this operation should be done in no time if the server was vital
@@ -1025,7 +1025,7 @@ class PortableContact
                        $xmlobj = @simplexml_load_string($serverret["body"], 'SimpleXMLElement', 0, "http://docs.oasis-open.org/ns/xri/xrd-1.0");
                }
 
-               if (!$serverret["success"] || ($serverret["body"] == "") || (sizeof($xmlobj) == 0) || !is_object($xmlobj)) {
+               if (!$serverret["success"] || ($serverret["body"] == "") || (empty($xmlobj) == 0) || !is_object($xmlobj)) {
                        // Workaround for bad configured servers (known nginx problem)
                        if (!in_array($serverret["debug"]["http_code"], ["403", "404"])) {
                                $failure = true;