aboutsummaryrefslogtreecommitdiff
path: root/p
diff options
context:
space:
mode:
Diffstat (limited to 'p')
-rw-r--r--p/api/greader.php3
-rw-r--r--p/f.php11
-rw-r--r--p/index.html18
-rw-r--r--p/themes/p.css17
4 files changed, 26 insertions, 23 deletions
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
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)) {
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 @@
<meta name="viewport" content="initial-scale=1.0" />
<meta http-equiv="Refresh" content="0; url=i/" />
<title>FreshRSS</title>
+<link rel="stylesheet" href="themes/p.css" />
<link rel="shortcut icon" type="image/x-icon" sizes="16x16 64x64" href="favicon.ico" />
<link rel="icon msapplication-TileImage apple-touch-icon" type="image/png" sizes="256x256" href="themes/icons/favicon-256.png" />
<meta name="msapplication-TileColor" content="#FFF" />
<meta name="robots" content="noindex" />
-<style>
-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;
-}
-</style>
</head>
<body>
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;
+}