diff --git a/Classes/ViewHelpers/FormViewHelper.php b/Classes/ViewHelpers/FormViewHelper.php index a69c92e..a84eb3a 100644 --- a/Classes/ViewHelpers/FormViewHelper.php +++ b/Classes/ViewHelpers/FormViewHelper.php @@ -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; }