From 63a9acb95a384253750391c631e240420c36f286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20T=C3=A4tzner?= Date: Thu, 16 Aug 2012 21:34:41 +0200 Subject: Remove broken favicon handling from discoverFavicon. Maybe re-add them later on or rework function. --- lib/utils.php | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) (limited to 'lib') diff --git a/lib/utils.php b/lib/utils.php index 1ecc92245..28b77e155 100644 --- a/lib/utils.php +++ b/lib/utils.php @@ -17,27 +17,27 @@ namespace OCA\News; require_once('news/3rdparty/SimplePie/autoloader.php'); class Utils { - + /** * @brief Transform a date from UNIX timestamp format to MDB2 timestamp format - * @param dbtimestamp - * @returns - */ + * @param dbtimestamp + * @returns + */ public static function unixtimeToDbtimestamp($unixtime) { $dt = \DateTime::createFromFormat('U', $unixtime); return $dt->format('Y-m-d H:i:s'); } - + /** * @brief Transform a date from MDB2 timestamp format to UNIX timestamp format - * @param dbtimestamp - * @returns + * @param dbtimestamp + * @returns */ public static function dbtimestampToUnixtime($dbtimestamp) { $dt = \DateTime::createFromFormat('Y-m-d H:i:s', $dbtimestamp); return $dt->format('U'); } - + /** * @brief Fetch a feed from remote * @param url remote url of the feed @@ -70,11 +70,11 @@ class Utils { if ($itemAuthor !== null) { $item->setAuthor($itemAuthor->get_name()); } - + //date in Item is stored in UNIX timestamp format $itemDate = $spitem->get_date('U'); $item->setDate($itemDate); - + $items[] = $item; } } @@ -139,20 +139,6 @@ class Utils { if(self::checkFavicon($favicon)) return $favicon; } - // test for an absolute path - elseif ( 0===strpos(parse_url($favicon,PHP_URL_PATH),'/') ) { - $url_token = parse_url($meta['final']); - sprintf( '%s://%s/%s', $url_token['scheme'], $url_token['host'], $favicon ); - if(self::checkFavicon($favicon)) - return $favicon; - } - // so it appears to be a relative path - else { - $url_token = parse_url($meta['final']); - sprintf( '%s://%s%s%s', $url_token['scheme'], $url_token['host'], dirname($url_token['path']), $favicon ); - if(self::checkFavicon($favicon)) - return $favicon; - } } } return null; -- cgit v1.2.3