Actions
Bug #94905
closedFE requests to /index.php are broken without providing id get parameter, if no pageTypeSuffix routeEnhancer is configured
Status:
Closed
Priority:
Should have
Assignee:
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2021-08-16
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:
Description
Affected Typo3 Versions: master, 10.4.20 LTS, 9.5.30 LTS
Requests to /index.php are not working anymore, if no ?id= parameter is provided since releases today (master, 10.4.20 LTS, 9.5.30 LTS ).
This is related to the patch(es) for https://forge.typo3.org/issues/94537.
If a routeEnhancer configuration with `.php` as default is configured, it works. Without it it is broken.
routeEnhancers:
PageTypeSuffix:
type: PageType
default: .php
index: index
map: { }
The reason is, that replaceing of the scriptName in the url.
// TYPO3\CMS\Core\Routing\PageRouter::matchRequest()
// doing this
$urlPath = ltrim(str_replace('/' . $scriptName, '', '/' . ltrim($urlPath, '/')), '/');
// instead of
$urlPath = str_replace('/' . $scriptName, '', $urlPath);
Would fix this and the related issue both, with and withoud a pageTypeSuffix configuration in routing. Anyway .. maybe a str_replace is to heavay, eventually it should only replace it at the starting ? Maybe doing upper as first fix and thinking about better/broader solution ?
Actions