Compatibility ORIG_PATH_INFO (#3560)

#fix https://github.com/FreshRSS/FreshRSS/issues/3542
This commit is contained in:
Alexandre Alapetite
2021-03-24 18:39:26 +01:00
committed by GitHub
parent d04166532a
commit 06fa514483

View File

@@ -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');