Skip to content

Commit f172838

Browse files
committed
Make sure numeric wildcards match to numeric endpoint requests
1 parent 3f6cf4f commit f172838

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

root/app/www/public/classes/Starr.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,18 @@ public function findWildcardEndpoint($starrApp, $endpoint)
255255
}
256256

257257
if ($accessMatches[1] == $requestMatches[1] . '/') {
258+
$invalidType = false;
259+
foreach ($accessMatches as $accessIndex => $accessMatch) {
260+
if (str_equals_any($accessMatch, ['{id}', '{seriesId}', '{movieId}']) && !is_numeric($requestMatches[$accessIndex])) {
261+
$invalidType = true;
262+
break;
263+
}
264+
}
265+
266+
if ($invalidType) {
267+
continue;
268+
}
269+
258270
$requestEndpointParts = explode('/', $endpoint);
259271
$starrEndpointParts = explode('/', $accessEndpoint);
260272

0 commit comments

Comments
 (0)