summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-08-20 19:50:53 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2012-08-20 19:50:53 -0400
commit70a37497ff0268fc0ebaaa68c1008f0721e66d4e (patch)
tree2992dfa3f0fd873ec966e70a94d30343d39fd9d4 /lib
parent3db8c525328e1595bd66b8f86057415855e4d6ef (diff)
small layout changes; fix error with retrieving favicon
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/utils.php b/lib/utils.php
index 1632849b6..ca5501f1f 100644
--- a/lib/utils.php
+++ b/lib/utils.php
@@ -82,7 +82,7 @@ class Utils {
$feed = new Feed($url, $title, $items);
$favicon = $spfeed->get_image_url();
-
+
if ($favicon !== null && self::checkFavicon($favicon)) { // use favicon from feed
$feed->setFavicon($favicon);
}
@@ -130,7 +130,9 @@ class Utils {
}
public static function checkFavicon($favicon) {
- var_dump($favicon);
+ if ($favicon === null || $favicon == false)
+ return false;
+
$file = new \SimplePie_File($favicon);
// size in bytes
$filesize = strlen($file->body);
@@ -156,7 +158,7 @@ class Utils {
//try to extract favicon from web page
$absoluteUrl = \SimplePie_Misc::absolutize_url('/', $url);
-
+
$handle = curl_init ( );
curl_setopt ( $handle, CURLOPT_URL, $absoluteUrl );
curl_setopt ( $handle, CURLOPT_RETURNTRANSFER, 1 );