Project

General

Profile

Actions

Bug #89126

closed

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

Added by Claus Due about 5 years ago. Updated almost 5 years ago.

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

100%

Estimated time:
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.
}

Actions

Also available in: Atom PDF