We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88e29bf commit b5d64ceCopy full SHA for b5d64ce
src/lib/Server/Input/Parser/RestoreTrashItemInput.php
@@ -15,6 +15,7 @@
15
use Ibexa\Rest\Server\Exceptions\ValidationFailedException;
16
use Ibexa\Rest\Server\Validation\Builder\Input\Parser\RestoreTrashItemInputValidatorBuilder;
17
use Symfony\Component\Validator\Validator\ValidatorInterface;
18
+use Webmozart\Assert\Assert;
19
20
final class RestoreTrashItemInput extends BaseParser
21
{
@@ -59,7 +60,11 @@ private function extractLocationIdFromPath(string $path): int
59
60
61
$pathParts = explode('/', $path);
62
- return (int)array_pop($pathParts);
63
+ $lastPart = array_pop($pathParts);
64
+
65
+ Assert::integerish($lastPart);
66
67
+ return (int)$lastPart;
68
}
69
70
/**
0 commit comments