aboutsummaryrefslogtreecommitdiff
path: root/p/api/greader.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-03-04 22:49:54 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-03-04 22:49:54 +0100
commit0694739969dcd8531d11545d27826470146e9975 (patch)
tree680859952191217a5badc66cf2f7df7f6fa9fee5 /p/api/greader.php
parentdffce6249778fb299229f8198252c91b5d34ceef (diff)
API: put back test getallheaders
https://github.com/marienfressinaud/FreshRSS/issues/443
Diffstat (limited to 'p/api/greader.php')
-rw-r--r--p/api/greader.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/p/api/greader.php b/p/api/greader.php
index 9b03bea3e..19241d55b 100644
--- a/p/api/greader.php
+++ b/p/api/greader.php
@@ -25,7 +25,9 @@ require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader
$ORIGINAL_INPUT = file_get_contents('php://input');
-if (!function_exists('getallheaders')) { //nginx http://php.net/getallheaders#84262
+$nativeGetallheaders = function_exists('getallheaders');
+
+if (!$nativeGetallheaders) { //nginx http://php.net/getallheaders#84262
function getallheaders() {
$headers = '';
foreach ($_SERVER as $name => $value) {
@@ -126,6 +128,10 @@ function checkCompatibility() {
if (PHP_INT_SIZE < 8 && !function_exists('gmp_init')) {
die('FAIL 64-bit or GMP extension!');
}
+ global $nativeGetallheaders;
+ if ((!$nativeGetallheaders) && isset($_SERVER['SERVER_SOFTWARE']) && (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') === false)) {
+ die('FAIL getallheaders! (probably)');
+ }
echo 'PASS';
exit();
}