summaryrefslogtreecommitdiffstats
path: root/utility
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-15 18:49:44 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-15 18:49:44 +0200
commit34342814a0e66764e36f815d23479f1735f146fc (patch)
tree99b9d1c4a8fc41de1477543b52f25c8432febb01 /utility
parent0ed9131f3f1c851158421b39767bf94264f80b8b (diff)
fix potential errors when fetching favicon that preven feed from being added, fix #66 by not shortening the url
Diffstat (limited to 'utility')
-rw-r--r--utility/feedfetcher.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/utility/feedfetcher.php b/utility/feedfetcher.php
index 4b91865f5..1f67d328e 100644
--- a/utility/feedfetcher.php
+++ b/utility/feedfetcher.php
@@ -204,7 +204,18 @@ class FeedFetcher implements IFeedFetcher {
// try the /favicon.ico as a last resort
$parseUrl = parse_url($url);
- $baseFavicon = $parseUrl['scheme'] . '://' . $parseUrl['host'] . '/favicon.ico';
+ if (!array_key_exists('scheme', $parseUrl)){
+ $scheme = 'http';
+ } else {
+ $scheme = $parseUrl['scheme'];
+ }
+
+ if(!array_key_exists('host', $parseUrl)){
+ error_log($url);
+ return null;
+ }
+
+ $baseFavicon = $scheme . '://' . $parseUrl['host'] . '/favicon.ico';
if($this->isValidFavIcon($baseFavicon)){
return $baseFavicon;
}