aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-03-10 21:26:52 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-03-10 21:26:52 +0100
commitf48fc2755c44d4968bce87cad13e1b4546aa7b2d (patch)
tree824c9965570fae62629bfdc1c056f602a56df14d
parentab1bec28c2a1e9534a66baa25a12b4639cbed726 (diff)
API: New test for getallheaders() problem
https://github.com/marienfressinaud/FreshRSS/issues/443
-rw-r--r--p/api/greader.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/p/api/greader.php b/p/api/greader.php
index 8ce1c5b9a..741c4fbd4 100644
--- a/p/api/greader.php
+++ b/p/api/greader.php
@@ -133,7 +133,9 @@ function checkCompatibility() {
if (PHP_INT_SIZE < 8 && !function_exists('gmp_init')) {
die('FAIL 64-bit or GMP extension!');
}
- if ((!function_exists('getallheaders')) && isset($_SERVER['SERVER_SOFTWARE']) && (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') === false)) {
+ if ((!array_key_exists('HTTP_AUTHORIZATION', $_SERVER)) && //Apache mod_rewrite trick should be fine
+ (empty($_SERVER['SERVER_SOFTWARE']) || (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') === false)) && //nginx should be fine
+ ((!function_exists('getallheaders')) || (stripos(php_sapi_name(), 'cgi') !== false))) { //Main problem is Apache/CGI mode
die('FAIL getallheaders! (probably)');
}
echo 'PASS';