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 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Link Handling, Site Handling & 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 #1

Updated by Simon Gilli over 2 years ago

  • Related to 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. added
Actions #2

Updated by Stefan Bürk over 2 years ago

working on it

Actions #3

Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #4

Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #5

Updated by Stefan Bürk over 2 years ago

  • Related to Bug #88028: index.php results in 404 added
Actions #6

Updated by Stefan Bürk over 2 years ago

  • Category set to Link Handling, Site Handling & Routing
  • Assignee set to Stefan Bürk
  • Complexity set to medium

Investigated this further/deeper

Benny Mack originally added the "block" for that scriptName replacement, to fix the call of "index.php" without "id" and "type" parameter back then when it was introduced in v9.
See: https://forge.typo3.org/issues/88028

Unluckily, there were no tests added to "cover" this, and so my patch for fixing another issue from me broke this again, undetected through tests and manually reviews / tests.
See: https://forge.typo3.org/issues/94537

Anyway, after adding the original patch, some noted that he had issue if it was in a "subfolder". See: https://forge.typo3.org/issues/88028#note-8

So I changed my "original" bugfix for this now back to "WIP", after these observations. I have added tests which was missing to cover the the original issue,
but now I (we) need to add some more tests to test this for "subpaths" installations to (if possible) - here I have to dig deeper in, maybe "needed hand" for this tests
would be nice (hints/notes how to accomplish this). But would not fix it without these tests.

Having these tests in place, the "solution" have to be tested and adjustet to cover all cases.

Actions #7

Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #8

Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #9

Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #10

Updated by Andreas Krämer over 2 years ago

I just discovered this problem, too. If it helps someone, "/index.php?type=123" does not work (anymore), but "/?type=123" does.

Actions #11

Updated by Stefan Bürk over 2 years ago

Andreas Krämer wrote in #note-10:

I just discovered this problem, too. If it helps someone, "/index.php?type=123" does not work (anymore), but "/?type=123" does.

Thanks, yes .. that constellation was also the first report and the reson we/I digged further into it.
Will be fixed with patch then. Anyway thanx for test data (better duplicated than none ).

For that there was no tests in place, fix & tests already in the patch sets (and other things).

Actions #12

Updated by Gerrit Code Review over 2 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #13

Updated by Gerrit Code Review over 2 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #14

Updated by Gerrit Code Review over 2 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #15

Updated by Gerrit Code Review over 2 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #16

Updated by Gerrit Code Review over 2 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #17

Updated by Gerrit Code Review over 2 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #18

Updated by Gerrit Code Review over 2 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #19

Updated by Gerrit Code Review over 2 years ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #20

Updated by Gerrit Code Review over 2 years ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #21

Updated by Gerrit Code Review over 2 years ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #22

Updated by Gerrit Code Review over 2 years ago

Patch set 16 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #23

Updated by Gerrit Code Review over 2 years ago

Patch set 17 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #24

Updated by Stefan Bürk over 2 years ago

  • TYPO3 Version changed from 9 to 10
Actions #25

Updated by Gerrit Code Review over 2 years ago

Patch set 18 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #26

Updated by Gerrit Code Review over 2 years ago

Patch set 19 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #27

Updated by Gerrit Code Review over 2 years ago

Patch set 20 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70640

Actions #28

Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72880

Actions #29

Updated by Stefan Bürk over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #30

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF