79462[BUGFIX] Avoid fatal error with invalid soft reference parser links
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Oliver Klee +1
-
Verified V +2 Done
- Benni Mack +2
- Oliver Klee +1
Issues 1
Files 7
- typo3/sysext/backend/Classes/Form/Element/LinkElement.php4+5 −7
- typo3/sysext/core/Classes/DataHandling/SoftReference/TypolinkSoftReferenceParser.php+7 −7
- typo3/sysext/core/Classes/DataHandling/SoftReference/TypolinkTagSoftReferenceParser.php+5 −5
- typo3/sysext/core/Classes/LinkHandling/LegacyLinkNotationConverter.php6+6 −0
- typo3/sysext/core/Tests/Unit/DataHandling/SoftReference/TypoLinkSoftReferenceParserTest.php+11 −0
- typo3/sysext/core/Tests/Unit/DataHandling/SoftReference/TypoLinkTagSoftReferenceParserTest.php+13 −0
- typo3/sysext/frontend/Classes/Typolink/LegacyLinkBuilder.php+2 −2
Review log 2736
Show 911 earlier messages
-
Torben Hansen uploaded patch set 1 06/20/23, 11:48
-
core-ci voted on patch set 1 V +1 06/20/23, 11:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42831
-
Benni Mack commented on patch set 1 06/20/23, 12:32
-
Torben Hansen commented on patch set 1 06/20/23, 13:57
LegacyLinkNotationConverter.php:89ReplyAgree, but there seems to be something wrong with the handling of TYPE_UNKNOWN links in LinkElement See https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Form/Element/LinkElement.php#L421 It expects `$linkData['file']`, which is/should not available for unknown type. Unsure how to proceed here. -
Benni Mack commented on patch set 1 06/20/23, 15:06
LegacyLinkNotationConverter.php:89Replytype unknown was introduced when people still had something like this in their links in RTEs: href="/fileadmin/my-pic.jpg" where we did or could not resolve to a file. That's why there is "file" (also in 1-2 other places), I guess we could change the unknown from "file" to "destination" or something like that? -
Torben Hansen rebased onto patch set 2
V +106/27/23, 13:32 -
core-ci voted on patch set 2 V +1 06/27/23, 13:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43033
-
Torben Hansen commented on patch set 2 06/27/23, 14:12
LegacyLinkNotationConverter.php:89ReplyI tried to change this to `LinkService::TYPE_UNKNOWN`, but then `LegacyLinkBuilder` crashes in frontend, because it can not proceed with the resolved unknown link type. Also `LinkService::TYPE_UNKNOWN` actually is a "known" type, so the form control displays the content as is and does not indicate to the user, that the whole link is wrong. `LinkService::TYPE_UNKNOWN` seems to be OK for links starting with a slash (e.g. old fileadmin-links), but for this special case, I think it is valid to return no type, so the `not implemented type` message is shown and the link is not processed by `LegacyLinkBuilder`. -
Benni Mack commented on patch set 2 07/03/23, 11:03
LegacyLinkNotationConverter.php:89Replymaybe we can steal the relevant parts from this change: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78604 -
Benni Mack uploaded patch set 3
V +107/03/23, 17:25 -
Benni Mack commented on patch set 3 07/03/23, 17:25
LegacyLinkNotationConverter.php:89ReplyDone
-
Benni Mack uploaded patch set 4 07/03/23, 17:30
-
core-ci voted on patch set 3 V +1 07/03/23, 17:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43273
-
core-ci voted on patch set 4 V +1 07/03/23, 17:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43274
-
Benni Mack voted on patch set 4 V +1 CR +1 07/03/23, 17:47
-
Benni Mack uploaded patch set 5
CR +1V +107/03/23, 18:01 -
Benni Mack updated the commit message in patch set 6 07/03/23, 18:01
-
core-ci voted on patch set 6 V +1 07/03/23, 18:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43278
-
core-ci voted on patch set 5 V +1 07/03/23, 18:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43277
-
Benni Mack uploaded patch set 7
V +107/03/23, 18:20 -
core-ci voted on patch set 7 V -1 07/03/23, 18:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43279
-
Benni Mack uploaded patch set 8
V -107/03/23, 18:40 -
core-ci voted on patch set 8 V +1 07/03/23, 18:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43280
-
Torben Hansen uploaded patch set 9
V +107/03/23, 19:01 -
core-ci voted on patch set 9 V +1 07/03/23, 19:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43283
-
Jochen Roth voted on patch set 9 V +1 CR +1 07/03/23, 19:28
-
Oliver Klee voted on patch set 9 V +1 07/03/23, 19:36
-
Oliver Klee commented on patch set 9 CR -1 07/03/23, 19:37
We also need to adapt to type annotations to match our changes (as they otherwise would not be correct).LinkElement.php:376File|nullLinkElement.php:386Folder|null -
Benni Mack commented on patch set 9 07/03/23, 19:54
Reply
can't we remove them if we have the instanceof checks? -
Oliver Klee commented on patch set 9 07/03/23, 20:03
Reply
Good catch - we can indeed! -
Benni Mack commented on patch set 10
CR +1V +107/03/23, 20:03Published edit on patch set 9. -
Benni Mack commented on patch set 10 07/03/23, 20:03
Reply
DoneLinkElement.php:376ReplyDoneLinkElement.php:386ReplyDone -
Benni Mack voted on patch set 10 V +1 CR +1 07/03/23, 20:03
-
Oliver Klee voted on patch set 10 V +1 CR +1 07/03/23, 20:10
-
Benni Mack voted on patch set 10 V +2 CR +2 07/03/23, 20:11
-
Benni Mack merged patch set 11 07/03/23, 20:11
LegacyLinkNotationConverter.php:89