Bug #89126

PageRouter ignores id=123 parameter if page record does not load

Added by Claus Due 2 months ago. Updated 12 days ago.

Status:
Resolved
Priority:
Must have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2019-09-10
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In PageRouter there exists a check if $_GET['id'] is provided, in which case, the legacy page handling is supposed to take priority.

But because of the way the condition is created, failure to resolve a page record (becuase of invalid uid) never triggers any error handling. Instead, the condition falls through to the "else" case which then resolves the default start page of the domain - because it ignores the "id" parameter and sees a single URL slug valued "/".

The solution is two parts: 1) if "id" is provided, never allow fallback to using site root page, and 2) if "id" does not resolve a page, trigger the error handler.

Condition is:

if (!empty($requestId) && ($page = $this->resolvePageId($requestId)) (
// no error handling happens here
} else {
// site configuration fallbacks processedhere
}

And must instead me:

if (!empty($requestId)) {
$page = $this->resolvePageId($requestId);
if (!$page) {
// trigger error handling
}
// existing processing for legacy ID
} else {
// site configuration fallback now explicitly can only happen if $requestId is not provided.
}

Associated revisions

Revision deebd9f4 (diff)
Added by Claus Due 12 days ago

[BUGFIX] Do not fall back to routes on invalid “id”

Prevents a logic issue where any failure to load
a record from “pages” based on $_GET[‘id’]
would cause incorrect behavior of falling back
to the site’s configured root page.

Inability to load the page record requested with
“id” in URL must trigger pageNotFoundAction
instead of rendering the site’s root page.

Change-Id: I731f7d078a654e44b8a197b5bf5cb41a4727bbe9
Resolves: #89126
Releases: 9.5
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61657
Tested-by: TYPO3com <>
Tested-by: Henning Liebe <>
Tested-by: Benni Mack <>
Reviewed-by: Henning Liebe <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Gerrit Code Review 2 months 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/+/61657

#2 Updated by Gerrit Code Review 2 months ago

Patch set 2 for branch 9.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/+/61657

#3 Updated by Anonymous 12 days ago

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

Also available in: Atom PDF