Skip to content

Commit

Permalink
Fix API use rawurldecode (FreshRSS#7033)
Browse files Browse the repository at this point in the history
Labels or categories containing a `+` were failing.
And avoid returning everything if the label/category filter is not found.
Compatibility with FocusReader
  • Loading branch information
Alkarex authored Nov 28, 2024
1 parent 15745d4 commit 98b8b9f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions p/api/greader.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ private static function streamContentsFilters(string $type, int|string $streamId
$streamId = htmlspecialchars((string)$streamId, ENT_COMPAT, 'UTF-8');
$cat = $categoryDAO->searchByName($streamId);
if ($cat != null) {
$type = 'c';
$streamId = $cat->id();
} else {
$tagDAO = FreshRSS_Factory::createTagDao();
Expand All @@ -605,7 +604,6 @@ private static function streamContentsFilters(string $type, int|string $streamId
$type = 't';
$streamId = $tag->id();
} else {
$type = 'A';
$streamId = -1;
}
}
Expand Down Expand Up @@ -970,7 +968,7 @@ public static function parse(): never {
} else {
$pathInfo = $_SERVER['PATH_INFO'];
}
$pathInfo = urldecode($pathInfo);
$pathInfo = rawurldecode($pathInfo);
$pathInfo = '' . preg_replace('%^(/api)?(/greader\.php)?%', '', $pathInfo); //Discard common errors
if ($pathInfo == '' && empty($_SERVER['QUERY_STRING'])) {
exit('OK');
Expand Down

0 comments on commit 98b8b9f

Please sign in to comment.