Project

General

Profile

Actions

Bug #94905

closed

FE requests to /index.php are broken without providing id get parameter, if no pageTypeSuffix routeEnhancer is configured

Added by Stefan Bürk over 3 years ago. Updated about 2 years ago.

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 ?


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #94537: Page could not be resolved if page slug ending in index and using PageSuffix RouteEnhancer to add .php suffix to all pages of a site.Closed2021-07-11

Actions
Related to TYPO3 Core - Bug #88028: index.php results in 404Closed2019-03-28

Actions
Actions

Also available in: Atom PDF