/** * Handles a request. The result output is returned by altering the given response. * * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler * * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException * @return void */ public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response) { if (!$this->canProcessRequest($request)) { throw new \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException(get_class($this) . ' does not support requests of type "' . get_class($request) . '". Supported types are: ' . implode(' ', $this->supportedRequestTypes), 1187701131); } if ($response instanceof \TYPO3\CMS\Extbase\Mvc\Web\Response && $request instanceof WebRequest) { $response->setRequest($request); } $this->request = $request; $this->request->setDispatched(true); $this->response = $response; $this->uriBuilder = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class); $this->uriBuilder->setRequest($request); $this->actionMethodName = $this->resolveActionMethodName(); $this->initializeActionMethodArguments(); $this->initializeActionMethodValidators(); $this->mvcPropertyMappingConfigurationService->initializePropertyMappingConfigurationFromRequest($request, $this->arguments); $this->initializeAction(); $actionInitializationMethodName = 'initialize' . ucfirst($this->actionMethodName); if (method_exists($this, $actionInitializationMethodName)) { call_user_func([$this, $actionInitializationMethodName]); } $this->mapRequestArgumentsToControllerArguments(); $this->controllerContext = $this->buildControllerContext(); $this->view = $this->resolveView(); if ($this->view !== null) { $this->initializeView($this->view); } $this->callActionMethod(); }
/** * Render the request hash field * * @return string The hmac field */ protected function renderTrustedPropertiesField() { $formFieldNames = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formFieldNames'); $requestHash = $this->mvcPropertyMappingConfigurationService->generateTrustedPropertiesToken($formFieldNames, $this->getFieldNamePrefix()); return '<input type="hidden" name="' . $this->prefixFieldName('__trustedProperties') . '" value="' . htmlspecialchars($requestHash) . '" />'; }