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 #1

Updated by Sybille Peters over 1 year ago

  • Description updated (diff)
Actions #2

Updated by Sybille Peters over 1 year ago

In TYPO3 v12 this is handled better: a flash message is displayed in the BE on saving.

Actions #3

Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

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/+/78692

Actions #4

Updated by Gerrit Code Review over 1 year ago

Patch set 2 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/+/78692

Actions #5

Updated by Oliver Bartsch over 1 year ago

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

Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF