diff options
| author | 2013-12-01 22:58:15 +0100 | |
|---|---|---|
| committer | 2013-12-01 22:58:15 +0100 | |
| commit | b0cbc6fe5da527aa2a4fedf4b138264ff983d159 (patch) | |
| tree | d3eff0f73423f7bc4e598a22d559a213dcf080ef /lib/lib_rss.php | |
| parent | baa8d21341d3f35a06815fd3f4ec536ef6ac2f3e (diff) | |
Favicons en parallèle
Nouvelle méthode pour afficher les favicons à la demande et en
parallèle.
Déplacement du dossier des favicons sous /data/favicons/
Devrait permettre de fermer le problème d'import OPML
https://github.com/marienfressinaud/FreshRSS/issues/228
Voir aussi https://github.com/marienfressinaud/FreshRSS/issues/290
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 46bf76d2c..c4ca03165 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -198,41 +198,6 @@ function get_content_by_parsing ($url, $path) { } } -/* Télécharge le favicon d'un site, le place sur le serveur et retourne l'URL */ -function download_favicon ($website, $id) { - $url = 'http://g.etfv.co/' . $website; - $favicons_dir = PUBLIC_PATH . '/favicons'; - $dest = $favicons_dir . '/' . $id . '.ico'; - - if (!is_dir ($favicons_dir)) { - if (!mkdir ($favicons_dir, 0755, true)) { - return $url; - } - } - - if (!file_exists ($dest)) { - $c = curl_init ($url); - curl_setopt ($c, CURLOPT_HEADER, false); - curl_setopt ($c, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($c, CURLOPT_BINARYTRANSFER, true); - $imgRaw = curl_exec ($c); - - if (curl_getinfo ($c, CURLINFO_HTTP_CODE) == 200) { - $file = fopen ($dest, 'w'); - if ($file === false) { - return $url; - } - - fwrite ($file, $imgRaw); - fclose ($file); - } else { - return $url; - } - - curl_close ($c); - } -} - /** * Add support of image lazy loading * Move content from src attribute to data-original |
