Skip to content
Snippets Groups Projects
Commit d06dee7e authored by Benni Mack's avatar Benni Mack Committed by Susanne Moog
Browse files

[BUGFIX] Ensure www.mydomain.com/index.php works

Calling just "index.php" without "id" and "type" parameter
should work as expected, as before.

Resolves: #88028
Releases: master, 9.5
Change-Id: I36df591b8b334b9b5908563ca554cab98acba32a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60503


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarAlexander Opitz <opitz.alexander@googlemail.com>
Tested-by: default avatarJosef Glatz <josefglatz@gmail.com>
Tested-by: default avatarSusanne Moog <look@susi.dev>
Reviewed-by: default avatarAlexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: default avatarJosef Glatz <josefglatz@gmail.com>
Reviewed-by: default avatarSusanne Moog <look@susi.dev>
parent 2d458ebe
Branches
Tags
No related merge requests found
......@@ -29,6 +29,7 @@ use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
use TYPO3\CMS\Core\Database\Query\Restriction\FrontendWorkspaceRestriction;
use TYPO3\CMS\Core\Exception\SiteNotFoundException;
use TYPO3\CMS\Core\Http\NormalizedParams;
use TYPO3\CMS\Core\Http\Uri;
use TYPO3\CMS\Core\Routing\Aspect\AspectFactory;
use TYPO3\CMS\Core\Routing\Aspect\MappableProcessor;
......@@ -117,6 +118,17 @@ class PageRouter implements RouterInterface
throw new RouteNotFoundException('No previous result given. Cannot find a page for an empty route part', 1555303496);
}
$urlPath = $previousResult->getTail();
// Remove the script name (e.g. index.php), if given
if (!empty($urlPath)) {
$normalizedParams = $request->getAttribute('normalizedParams');
if ($normalizedParams instanceof NormalizedParams) {
$scriptName = ltrim($normalizedParams->getScriptName(), '/');
if (strpos($urlPath, $scriptName) !== false) {
$urlPath = str_replace($scriptName, '', $urlPath);
}
}
}
$prefixedUrlPath = '/' . trim($urlPath, '/');
$slugCandidates = $this->getCandidateSlugsFromRoutePath($urlPath ?: '/');
$pageCandidates = [];
......
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