Explorar el Código

Compatibility ORIG_PATH_INFO (#3560)

#fix https://github.com/FreshRSS/FreshRSS/issues/3542
Alexandre Alapetite hace 5 años
padre
commit
06fa514483
Se han modificado 1 ficheros con 10 adiciones y 1 borrados
  1. 10 1
      p/api/greader.php

+ 10 - 1
p/api/greader.php

@@ -939,7 +939,16 @@ function markAllAsRead($streamId, $olderThanId) {
 	exit('OK');
 }
 
-$pathInfo = empty($_SERVER['PATH_INFO']) ? '' : urldecode($_SERVER['PATH_INFO']);
+$pathInfo = '';
+if (empty($_SERVER['PATH_INFO'])) {
+	if (!empty($_SERVER['ORIG_PATH_INFO'])) {
+		// Compatibility https://php.net/reserved.variables.server
+		$pathInfo = $_SERVER['ORIG_PATH_INFO'];
+	}
+} else {
+	$pathInfo = $_SERVER['PATH_INFO'];
+}
+$pathInfo = urldecode($pathInfo);
 $pathInfo = preg_replace('%^(/api)?(/greader\.php)?%', '', $pathInfo);	//Discard common errors
 if ($pathInfo == '') {
 	exit('OK');