]> git.mxchange.org Git - friendica.git/commitdiff
Fix test
authorMichael <heluecht@pirati.ca>
Fri, 29 Jul 2022 14:56:40 +0000 (14:56 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 29 Jul 2022 14:56:40 +0000 (14:56 +0000)
src/Model/Item.php

index a465e8c93c5f5fae8e6f5d13736e64d26aede265..e0ca507174f4bd45ba71565e5a133f9a01552be4 100644 (file)
@@ -2945,9 +2945,13 @@ class Item
        {
                // Make sure that for example site parameters aren't used when testing if the link is contained in the body
                $urlparts = parse_url($url);
-               unset($urlparts['query']);
-               unset($urlparts['fragment']);
-               $url = Uri::fromParts($urlparts);
+               if (!empty($urlparts)) {
+                       unset($urlparts['query']);
+                       unset($urlparts['fragment']);
+                       $url = Uri::fromParts($urlparts);
+               } else {
+                       return false;
+               }
 
                // Remove media links to only search in embedded content
                // @todo Check images for image link, audio for audio links, ...