summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGregor Tätzner <gregor@freenet.de>2012-07-21 23:25:39 +0200
committerGregor Tätzner <gregor@freenet.de>2012-07-21 23:25:39 +0200
commit81e6a72a20e115ba8d11e23c0677a0915fedf3ff (patch)
tree4e282f075f1680d971148e5483728471d343d7f3 /lib
parent5ab51aa17656548a047ebe8d7aee74ce1f89c020 (diff)
Improve favicon detection
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/utils.php b/lib/utils.php
index 24dd5493e..a20fc5be8 100644
--- a/lib/utils.php
+++ b/lib/utils.php
@@ -44,11 +44,16 @@ class OC_News_Utils {
$favicon = $spfeed->get_image_url();
//check if this file exists and the size with getimagesize()
-
+
if ($favicon == null) {
//handle favicon detection
+ $favicon = SimplePie_Misc::absolutize_url('/favicon.ico', $url);
+
+ // FIXME check if file exists and is valid
+ if (false === file_get_contents($favicon, 0, null, 0, 1))
+ $favicon = null;
}
-
+
$feed->setFavicon($favicon);
return $feed;