File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
src/lib/Server/Input/Parser Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 4141 "symfony/routing" : " ^5.3" ,
4242 "symfony/security-bundle" : " ^5.3" ,
4343 "symfony/security-csrf" : " ^5.3" ,
44- "symfony/yaml" : " ^5.3"
44+ "symfony/yaml" : " ^5.3" ,
45+ "webmozart/assert" : " ^1.11"
4546 },
4647 "require-dev" : {
4748 "ibexa/ci-scripts" : " ^0.2@dev" ,
Original file line number Diff line number Diff line change 1515use Ibexa \Rest \Server \Exceptions \ValidationFailedException ;
1616use Ibexa \Rest \Server \Validation \Builder \Input \Parser \RestoreTrashItemInputValidatorBuilder ;
1717use Symfony \Component \Validator \Validator \ValidatorInterface ;
18+ use Webmozart \Assert \Assert ;
1819
1920final class RestoreTrashItemInput extends BaseParser
2021{
@@ -59,7 +60,11 @@ private function extractLocationIdFromPath(string $path): int
5960 {
6061 $ pathParts = explode ('/ ' , $ path );
6162
62- return (int )array_pop ($ pathParts );
63+ $ lastPart = array_pop ($ pathParts );
64+
65+ Assert::integerish ($ lastPart );
66+
67+ return (int )$ lastPart ;
6368 }
6469
6570 /**
You can’t perform that action at this time.
0 commit comments