Commit 236ce5fc authored by Benni Mack's avatar Benni Mack Committed by Stefan Bürk
Browse files

[TASK] Avoid usage of UriBuilder and Extbase Request

Due to cleanups some, usages of Extbase's Request
and UriBuilder can be removed.

Resolves: #98398
Releases: main
Change-Id: Ifac91344c404d5e1d3beee2ec882da2de309d61e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75806


Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
parent dabe04ec
......@@ -29,7 +29,6 @@ use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject;
use TYPO3\CMS\Extbase\DomainObject\AbstractValueObject;
use TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentValueException;
use TYPO3\CMS\Extbase\Mvc\Request;
use TYPO3\CMS\Extbase\Mvc\RequestInterface;
use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy;
use TYPO3\CMS\Extbase\Service\ExtensionService;
......
......@@ -20,8 +20,6 @@ namespace TYPO3\CMS\Form\Domain\Finishers;
use TYPO3\CMS\Core\Http\PropagateResponseException;
use TYPO3\CMS\Core\Http\RedirectResponse;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\RequestInterface;
use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
/**
* This finisher redirects to another Controller.
......@@ -41,24 +39,12 @@ class RedirectFinisher extends AbstractFinisher
'fragment' => '',
];
protected RequestInterface $request;
/**
* @var \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder
*/
protected $uriBuilder;
/**
* Executes this finisher
* @see AbstractFinisher::execute()
*/
protected function executeInternal()
{
$formRuntime = $this->finisherContext->getFormRuntime();
$this->request = $formRuntime->getRequest();
$this->uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$this->uriBuilder->setRequest($this->request);
$pageUid = $this->parseOption('pageUid');
$pageUid = (int)str_replace('pages_', '', (string)$pageUid);
$additionalParameters = $this->parseOption('additionalParameters');
......@@ -84,7 +70,7 @@ class RedirectFinisher extends AbstractFinisher
* @param int $statusCode (optional) The HTTP status code for the redirect. Default is "303 See Other
* @see forward()
*/
protected function redirect(int $pageUid = 1, string $additionalParameters = '', string $fragment = '', int $statusCode = 303)
protected function redirect(int $pageUid, string $additionalParameters, string $fragment, int $statusCode)
{
$typolinkConfiguration = [
'parameter' => $pageUid,
......@@ -123,6 +109,6 @@ class RedirectFinisher extends AbstractFinisher
*/
protected function addBaseUriIfNecessary(string $uri): string
{
return GeneralUtility::locationHeaderUrl((string)$uri);
return GeneralUtility::locationHeaderUrl($uri);
}
}
......@@ -38,9 +38,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Error\Result;
use TYPO3\CMS\Extbase\Mvc\ExtbaseRequestParameters;
use TYPO3\CMS\Extbase\Mvc\Request;
use TYPO3\CMS\Extbase\Mvc\RequestInterface;
use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
use TYPO3\CMS\Extbase\Property\Exception as PropertyException;
use TYPO3\CMS\Extbase\Security\Cryptography\HashService;
use TYPO3\CMS\Extbase\Security\Exception\InvalidArgumentForHashGenerationException;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment