Project

General

Profile

Actions

Bug #95166

closed

Linkvalidator breaks if no pageUid

Added by Michael Sollmann over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Linkvalidator
Target version:
-
Start date:
2021-09-09
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

The linkvalidator breaks if no pageUid is given. If in inline records (IRRE), these records could not be opened anymore.

Error:
Uncaught TYPO3 Exception: htmlspecialchars() expects parameter 1 to be string, null given | TypeError thrown in file [...]typo3_src-10.4.14/typo3/sysext/linkvalidator/Classes/EventListener/CheckBrokenRteLinkEventListener.php in line 67.

Possible solution:

// Page does not exist
if (!is_array($pageRecord)) {
        if ($hrefInformation['pageuid'])
            $event->markAsBrokenLink('Page with ID ' . htmlspecialchars($hrefInformation['pageuid']) . ' not found');
        else
            $event->markAsBrokenLink('Page not found - missing ID');
}

Actions #1

Updated by Georg Ringer over 2 years ago

can you add some information how this can be reproduced?

Actions #2

Updated by Michael Sollmann over 2 years ago

I don't know. Editors who worked in source code mode of the RTE? Anyway, there was a crippled typolink in a RTE field, and if this is possible we have to catch the error :-)

Actions #3

Updated by Franz Kugelmann over 2 years ago

Just stumbled upon this issue. To reproduce, add the following link directly into a tt_content::bodytext field.
NOT via "source code view" in RTE, that will already add the missing uid-parameter.

<a title="ICMU" href="t3://page?alias=-">(ICMU)</a>

I have no idea how that link was created by the editors, but found 60 more such links with parameter alias instead of uid in the Database.

Actions #4

Updated by Sybille Peters over 2 years ago

@Frank I can reproduce this with your description.

Not sure how linkvalidator should behave. Is a link href="t3://page?alias=-" a valid link target? Does it implicitly mean link to current page?

Because this link is rendered as working link to current page, I would assume so.

Actions #5

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

Actions #6

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

Actions #7

Updated by Sybille Peters over 2 years ago

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

Updated by Gerrit Code Review over 2 years ago

  • Status changed from Resolved to Under Review

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

Actions #9

Updated by Gerrit Code Review over 2 years ago

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

Actions #10

Updated by Sybille Peters over 2 years ago

  • Status changed from Under Review to Resolved
Actions #11

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF