diff options
author | Gregor Tätzner <gregor@freenet.de> | 2012-08-16 21:34:41 +0200 |
---|---|---|
committer | Gregor Tätzner <gregor@freenet.de> | 2012-08-16 21:34:41 +0200 |
commit | 63a9acb95a384253750391c631e240420c36f286 (patch) | |
tree | af195b51047128ed548a84126e132f415c61f770 /lib/utils.php | |
parent | 9132f6a27d8f26bfbf333a3d6d36361d1e0a2fa3 (diff) |
Remove broken favicon handling from discoverFavicon.
Maybe re-add them later on or rework function.
Diffstat (limited to 'lib/utils.php')
-rw-r--r-- | lib/utils.php | 34 |
1 files changed, 10 insertions, 24 deletions
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; |