From a0256023a19c524c5880b91ad08651eca33dc221 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 19 Jun 2020 23:01:51 +0200 Subject: 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 --- p/api/greader.php | 1 + 1 file changed, 1 insertion(+) (limited to 'p/api/greader.php') 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'); } -- cgit v1.2.3