]> git.mxchange.org Git - friendica.git/commitdiff
Properly handle feed item urls with surrounding whitespace
authorDaniel Siepmann <coding@daniel-siepmann.de>
Thu, 12 Jan 2023 12:43:49 +0000 (13:43 +0100)
committerDaniel Siepmann <coding@daniel-siepmann.de>
Thu, 12 Jan 2023 12:47:57 +0000 (13:47 +0100)
Some feeds might have whitespace around the URLs of each item.
This can't be handled by parse_url.
Therefore the incoming url is trimmed to not contain any surrounding
whitespace for proper handling.

Relates: #12658

src/Util/Network.php

index f9f32d42229fcf88392202960adbb26e84a10059..30c4798a5a985dc1db09d4545a04f73c7009d9d5 100644 (file)
@@ -376,6 +376,7 @@ class Network
         */
        public static function addBasePath(string $url, string $basepath): string
        {
+               $url = trim($url);
                if (!empty(parse_url($url, PHP_URL_SCHEME)) || empty(parse_url($basepath, PHP_URL_SCHEME)) || empty($url) || empty(parse_url($url))) {
                        return $url;
                }