diff options
Diffstat (limited to 'lib/Fetcher/FeedFetcher.php')
-rwxr-xr-x | lib/Fetcher/FeedFetcher.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php index a1924a10f..a7c4192e2 100755 --- a/lib/Fetcher/FeedFetcher.php +++ b/lib/Fetcher/FeedFetcher.php @@ -329,9 +329,13 @@ class FeedFetcher implements IFeedFetcher ini_set('user_agent', 'NextCloud-News/1.0'); + $base_url = new Net_URL2($url); + $base_url->setPath(""); + $base_url = $base_url->getNormalizedURL(); + // check if feed has a logo entry if (is_null($favicon) || trim($favicon) === '') { - return $this->faviconFactory->get($url); + return $this->faviconFactory->get($base_url); } $favicon_path = join("/", [$this->ITempManager->getTempBaseDir(), basename($favicon)]); @@ -346,13 +350,13 @@ class FeedFetcher implements IFeedFetcher // check if file is actually an image if (!$is_image) { - return $this->faviconFactory->get($url); + return $this->faviconFactory->get($base_url); } list($width, $height, $type, $attr) = getimagesize($favicon_path); // check if image is square else fall back to favicon if ($width !== $height) { - return $this->faviconFactory->get($url); + return $this->faviconFactory->get($base_url); } return $favicon; |