Skip to content

Commit 449f294

Browse files
emodricpspanja
authored andcommitted
Cast locationId and contentId to integer
It turns out they can end up as strings when supplied to route config via container parameters
1 parent 70a7842 commit 449f294

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

bundle/View/Builder/ContentViewBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function buildView(array $parameters): ContentView
5959
}
6060

6161
if (isset($parameters['locationId'])) {
62-
$location = $this->loadLocation($parameters['locationId']);
62+
$location = $this->loadLocation((int) $parameters['locationId']);
6363
} elseif (isset($parameters['location'])) {
6464
$location = $parameters['location'];
6565
if ($location instanceof APILocation) {
@@ -76,7 +76,7 @@ public function buildView(array $parameters): ContentView
7676
}
7777
} else {
7878
if (isset($parameters['contentId'])) {
79-
$contentId = $parameters['contentId'];
79+
$contentId = (int) $parameters['contentId'];
8080
} elseif (isset($location)) {
8181
$contentId = $location->contentInfo->id;
8282
} else {

0 commit comments

Comments
 (0)