diff options
| author | 2020-03-30 19:17:12 +0200 | |
|---|---|---|
| committer | 2020-03-30 19:17:12 +0200 | |
| commit | c79c7640a257dbe1771079bace85d60829c6f0b9 (patch) | |
| tree | 45088e2c6a50f837277a7bf62ce127af331142a4 /p/api/greader.php | |
| parent | fc1fb57a7f8b574be2c7b186ed03db74250089f4 (diff) | |
API return OK for an empty request (#2855)
Fix https://framateam.org/freshrss/pl/yozcezrnufno9eut3173d4wpry
Diffstat (limited to 'p/api/greader.php')
| -rw-r--r-- | p/api/greader.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/p/api/greader.php b/p/api/greader.php index 409babe91..2d1acca16 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -883,8 +883,14 @@ function markAllAsRead($streamId, $olderThanId) { exit('OK'); } -$pathInfo = empty($_SERVER['PATH_INFO']) ? '/Error' : urldecode($_SERVER['PATH_INFO']); +$pathInfo = empty($_SERVER['PATH_INFO']) ? '' : urldecode($_SERVER['PATH_INFO']); +if ($pathInfo == '') { + exit('OK'); +} $pathInfos = explode('/', $pathInfo); +if (count($pathInfos) < 3) { + badRequest(); +} Minz_Configuration::register('system', DATA_PATH . '/config.php', @@ -896,8 +902,6 @@ FreshRSS_Context::$system_conf = Minz_Configuration::get('system'); if (!FreshRSS_Context::$system_conf->api_enabled) { serviceUnavailable(); -} elseif (count($pathInfos) < 3) { - badRequest(); } elseif ($pathInfos[1] === 'check' && $pathInfos[2] === 'compatibility') { checkCompatibility(); } |
