aboutsummaryrefslogtreecommitdiff
path: root/p/api/greader.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2020-06-19 23:01:51 +0200
committerGravatar GitHub <noreply@github.com> 2020-06-19 23:01:51 +0200
commita0256023a19c524c5880b91ad08651eca33dc221 (patch)
tree73e67be550a2e564c51e4d8b4c4c1c55ad53edb0 /p/api/greader.php
parent5c9d6a5396eb43739eb1c17540228c20a16f4554 (diff)
API discard common Path Info errors (#3061)
Some apps auto-complete `/api/greader.php` while some do not. Discard common errors instead of failing, to be more user-friendly. E.g. if the user types the full API URL in Readrops https://github.com/FreshRSS/FreshRSS/issues/3059#issuecomment-644149548
Diffstat (limited to 'p/api/greader.php')
-rw-r--r--p/api/greader.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/p/api/greader.php b/p/api/greader.php
index b87387bd7..dfeb534fc 100644
--- a/p/api/greader.php
+++ b/p/api/greader.php
@@ -912,6 +912,7 @@ function markAllAsRead($streamId, $olderThanId) {
}
$pathInfo = empty($_SERVER['PATH_INFO']) ? '' : urldecode($_SERVER['PATH_INFO']);
+$pathInfo = preg_replace('%^(/api)?(/greader\.php)?%', '', $pathInfo); //Discard common errors
if ($pathInfo == '') {
exit('OK');
}