Project

General

Profile

Actions

Bug #100565

closed

Wrong format of link in sys_redirect.target may cause exceptions

Added by Sybille Peters over 1 year ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2023-04-12
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I am not sure if this should be considered a bug. The entered link in sys_redirect.target was wrong.

Possible improvements:

- If the link entered in sys_redirects.target is wrong, display this with a warning (!) in the form
- better errror handling so that excption is not thrown, but log message is generated

Reproduce (1):

1. Create a redirect with sys_redirect.target=" t3://page=uid=18&_language=1 "
2. Save the record: exception will be displayed, but record is saved nonetheless.

The exception also occurs if the record already exists and:

  • reference index is updated
  • a filter is entered in redirects module which has this entry as result.

Error message

Update index of table sys_redirect
----------------------------------

 2554/6384 [▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░]  40%
In ErrorHandler.php line 137:

  PHP Warning: Undefined array key "page=uid=18&_language=1" in /var/www/mysite/htdocs/typo3/sysext/core/Classes/LinkHandling/LinkService.php line 119  

Versions

  • TYPO3 11.5.26
  • Composer installation
  • PHP 8.1

Code

core/Classes/LinkHandling/LinkService.php

v11:

119 if (is_object($this->handlers[$type])) {

v12 (main):

if (isset($this->handlers[$type])) {
  $result = $this->handlers[$type]->resolveHandlerData($data);
  $result['type'] = $type;
} else {
  throw new UnknownLinkHandlerException('LinkHandler for ' . $type . ' was not registered', 1460581769);
}

Actions

Also available in: Atom PDF