Skip to content

Commit

Permalink
Merge pull request #132 from sorenmalling/task/use-uri-object-for
Browse files Browse the repository at this point in the history
TASK: Replace preg_replace with PSR-7 UriInterface method for action uri
  • Loading branch information
bwaidelich committed Jan 11, 2021
2 parents 7ebd9ec + 85f7414 commit ddc25b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/ViewHelpers/FormViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ protected function getFormActionUri()
/** @var ActionRequest $actionRequest */
$actionRequest = $this->controllerContext->getRequest();
$uri = $actionRequest->getHttpRequest()->getUri();
if ($this->hasArgument('section')) {
$uri = preg_replace('/#.*$/', '', $uri) . '#' . $this->arguments['section'];
if ($this->hasArgument('section') && $this->arguments['section'] !== '') {
$uri->withFragment($this->hasArgument('section'));
}
return (string)$uri;
}
Expand Down

0 comments on commit ddc25b3

Please sign in to comment.