]> git.mxchange.org Git - friendica.git/commitdiff
Accept URLs with no trailing slash in Probe::uri
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 10 Nov 2018 13:22:47 +0000 (08:22 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 10 Nov 2018 13:22:47 +0000 (08:22 -0500)
src/Network/Probe.php

index d870e06f9711f1e90a6bf01aa21bdfe418cfd2f7..aa770b92eeb8a3d5f01b68f6da15ce9cdd25ca6a 100644 (file)
@@ -575,7 +575,7 @@ class Probe
        {
                $parts = parse_url($uri);
 
-               if (!empty($parts["scheme"]) && !empty($parts["host"]) && !empty($parts["path"])) {
+               if (!empty($parts["scheme"]) && !empty($parts["host"])) {
                        $host = $parts["host"];
                        if (!empty($parts["port"])) {
                                $host .= ':'.$parts["port"];
@@ -590,7 +590,7 @@ class Probe
                                return [];
                        }
 
-                       $path_parts = explode("/", trim($parts["path"], "/"));
+                       $path_parts = explode("/", trim(defaults($parts, 'path', ''), "/"));
 
                        while (!$lrdd && (sizeof($path_parts) > 1)) {
                                $host .= "/".array_shift($path_parts);