From a41163ac46824fb23a17a5a1013239c2f356dbde Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 17 Mar 2016 21:09:34 +0100 Subject: CSP compatibility for home page https://github.com/FreshRSS/FreshRSS/issues/1075 --- p/index.html | 18 +----------------- p/themes/p.css | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 p/themes/p.css (limited to 'p') diff --git a/p/index.html b/p/index.html index ef5cb87ce..3f4284eb5 100644 --- a/p/index.html +++ b/p/index.html @@ -5,27 +5,11 @@ FreshRSS + - diff --git a/p/themes/p.css b/p/themes/p.css new file mode 100644 index 000000000..171b2078b --- /dev/null +++ b/p/themes/p.css @@ -0,0 +1,17 @@ +@charset "UTF-8"; + +body { + font-family: sans-serif; + text-align: center; +} +h1 { + font-size: xx-large; + text-shadow: 1px -1px 0 #CCCCCC; +} +h1 a { + color: #0062BE; + text-decoration: none; +} +img { + border: 0; +} -- cgit v1.2.3 From 06189cb6661edf75079037f90cf82276ab5f5648 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 10 Apr 2016 11:52:16 +0200 Subject: API support for REDIRECT HTTP headers https://github.com/FreshRSS/FreshRSS/issues/1127 --- p/api/greader.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'p') diff --git a/p/api/greader.php b/p/api/greader.php index 62782ce1a..894c2e960 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -46,6 +46,8 @@ function headerVariable($headerName, $varName) { $upName = 'HTTP_' . strtoupper($headerName); if (isset($_SERVER[$upName])) { $header = $_SERVER[$upName]; + } elseif (isset($_SERVER['REDIRECT_' . $upName])) { + $header = $_SERVER['REDIRECT_' . $upName]; } elseif (function_exists('getallheaders')) { $ALL_HEADERS = getallheaders(); if (isset($ALL_HEADERS[$headerName])) { @@ -134,6 +136,7 @@ function checkCompatibility() { die('FAIL 64-bit or GMP extension!'); } if ((!array_key_exists('HTTP_AUTHORIZATION', $_SERVER)) && //Apache mod_rewrite trick should be fine + (!array_key_exists('REDIRECT_HTTP_AUTHORIZATION', $_SERVER)) && //Apache mod_rewrite with FCGI (empty($_SERVER['SERVER_SOFTWARE']) || (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') === false)) && //nginx should be fine (empty($_SERVER['SERVER_SOFTWARE']) || (stripos($_SERVER['SERVER_SOFTWARE'], 'lighttpd') === false)) && //lighttpd should be fine ((!function_exists('getallheaders')) || (stripos(php_sapi_name(), 'cgi') !== false))) { //Main problem is Apache/CGI mode -- cgit v1.2.3 From 624824673592dbc21300f9a26c27781f54429de5 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 23 Apr 2016 21:48:37 +0200 Subject: Adjust caching for favicon with errors --- p/f.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'p') diff --git a/p/f.php b/p/f.php index c904e1fcb..0f23921e3 100644 --- a/p/f.php +++ b/p/f.php @@ -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)) { -- cgit v1.2.3