Skip to content
Snippets Groups Projects
Commit efc0d221 authored by Kevin von Spiczak's avatar Kevin von Spiczak
Browse files

[BUGFIX] fix page not found logic for unsolicited applications

parent 5dbdda49
No related branches found
No related tags found
No related merge requests found
......@@ -367,6 +367,7 @@ class JoblistController extends ActionController {
* @return ResponseInterface
* @throws AspectNotFoundException
* @throws SiteNotFoundException
* @throws ImmediateResponseException
* @throws PageNotFoundException
*/
public function applyFormAction(
......@@ -381,10 +382,21 @@ class JoblistController extends ActionController {
// Check if this page is explicitly configured as an unsolicited application page.
if (($this->settings['isUnsolicitedApplicationPage'] ?? FALSE) && $jobId !== NULL) {
/** @var PageRenderer $pageRenderer */
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
// the PageRenderer contains the content of the current request, the result of the following sub-request will
// be appended to it, and we get 2 pages, the current one and the 404-page in one. We flush the PageRenderer
// content here, so it will contain only the 404-page content
$pageRenderer->setBodyContent('');
// For unsolicited pages, a job parameter is not allowed
throw new \TYPO3\CMS\Core\Error\Http\PageNotFoundException(
'Job parameter is not allowed on an unsolicited application page.'
$response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
$GLOBALS['TYPO3_REQUEST'],
'Job parameter is not allowed on an unsolicited application page.',
['code' => PageAccessFailureReasons::PAGE_NOT_FOUND]
);
throw new ImmediateResponseException($response, 1741779370);
}
// For regular application pages, if the disallow unsolicited setting is explicitly enabled and no job
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment