Skip to content

Commit

Permalink
[BUGFIX] Fix PHP warnings for undefined array key
Browse files Browse the repository at this point in the history
  • Loading branch information
theLine committed Feb 27, 2023
1 parent 67d7756 commit 944d00e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Classes/Uri/TyposcriptRenderingUri.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private function parseViewHelperContext(ViewHelperContext $viewHelperContext): v
$pluginName = $arguments['pluginName'] ?? null;
$extensionName = $arguments['extensionName'] ?? null;
$contextRecord = $arguments['contextRecord'];
$additionalParams = $arguments['additionalParams'];
$additionalParams = $arguments['additionalParams'] ?? [];
$renderingPath = $arguments['typoscriptObjectPath'] ?? null;

if ($pluginName === null) {
Expand Down Expand Up @@ -95,8 +95,10 @@ private function parseViewHelperContext(ViewHelperContext $viewHelperContext): v
->setAddQueryString($arguments['addQueryString'] ?? false)
->setAddQueryStringMethod('GET')
->setArgumentsToBeExcludedFromQueryString($arguments['argumentsToBeExcludedFromQueryString'] ?? []);
if (MathUtility::canBeInterpretedAsInteger($arguments['pageUid'])) {
$uriBuilder->setTargetPageUid((int)$arguments['pageUid']);

$targetPageUid = $arguments['pageUid'] ?? null;
if (MathUtility::canBeInterpretedAsInteger($targetPageUid)) {
$uriBuilder->setTargetPageUid((int)$targetPageUid);
}

$this->parseUri(
Expand Down Expand Up @@ -124,7 +126,7 @@ private function parseWidgetContext(ViewHelperContext $viewHelperContext): void
$pluginName = $arguments['pluginName'] ?? null;
$extensionName = $arguments['extensionName'] ?? null;
$contextRecord = $arguments['contextRecord'];
$additionalParams = $arguments['additionalParams'];
$additionalParams = $arguments['additionalParams'] ?? [];
$renderingPath = $arguments['typoscriptObjectPath'] ?? null;

if ($pluginName === null) {
Expand Down Expand Up @@ -167,8 +169,10 @@ private function parseWidgetContext(ViewHelperContext $viewHelperContext): void
->setAddQueryString(true)
->setAddQueryStringMethod('GET')
->setArgumentsToBeExcludedFromQueryString($arguments['argumentsToBeExcludedFromQueryString'] ?? []);
if (MathUtility::canBeInterpretedAsInteger($arguments['pageUid'])) {
$uriBuilder->setTargetPageUid((int)$arguments['pageUid']);

$targetPageUid = $arguments['pageUid'] ?? null;
if (MathUtility::canBeInterpretedAsInteger($targetPageUid)) {
$uriBuilder->setTargetPageUid((int)$targetPageUid);
}

$uri = $uriBuilder->build();
Expand Down

0 comments on commit 944d00e

Please sign in to comment.