diff options
| author | 2016-06-12 22:21:57 +0200 | |
|---|---|---|
| committer | 2016-06-12 22:21:57 +0200 | |
| commit | 7bc2ff45009a601550d77007c94ec23e2ced8f19 (patch) | |
| tree | 8f175b55e291a152d2811d85f4a6d085f18f6849 /p/f.php | |
| parent | 8dcc0fd65a36adedb12e5d54bafb39e7e553d38b (diff) | |
| parent | 17de4363b5b0ab3f3ddc703ccf98332770040e17 (diff) | |
Merge pull request #1165 from FreshRSS/dev1.3.2-beta
Release 1.3.2-beta
Diffstat (limited to 'p/f.php')
| -rw-r--r-- | p/f.php | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -44,14 +44,13 @@ function download_favicon($website, $dest) { } -function show_default_favicon() { +function show_default_favicon($cacheSeconds = 3600) { global $default_favicon; - header('Content-Type: image/x-icon'); header('Content-Disposition: inline; filename="default_favicon.ico"'); $default_mtime = @filemtime($default_favicon); - if (!httpConditional($default_mtime, 2592000, 2)) { + if (!httpConditional($default_mtime, $cacheSeconds, 2)) { readfile($default_favicon); } } @@ -68,10 +67,11 @@ $ico = $favicons_dir . $id . '.ico'; $ico_mtime = @filemtime($ico); $txt_mtime = @filemtime($txt); +header('Content-Type: image/x-icon'); if ($ico_mtime == false || $txt_mtime > $ico_mtime) { if ($txt_mtime == false) { - show_default_favicon(); + show_default_favicon(1800); return; } @@ -79,12 +79,11 @@ if ($ico_mtime == false || $txt_mtime > $ico_mtime) { $url = file_get_contents($txt); if (!download_favicon($url, $ico)) { // Download failed, show the default favicon - show_default_favicon(); + show_default_favicon(86400); return; } } -header('Content-Type: image/x-icon'); header('Content-Disposition: inline; filename="' . $id . '.ico"'); if (!httpConditional($ico_mtime, 2592000, 2)) { |
