Review main Merged

96016[FEATURE] Improve link handling in the CKEditor link plugin

Benni Mack CR +2 V +2 Hard +827 −24 updated 09/28/26, 19:45

Commit message

The link plugin now resolves TYPO3 link targets such as
t3://page?uid=3 via the new backend AJAX route "link_preview"
(respecting page and file permissions) and uses the result:

* A new link without selected text uses the link title or the
  title of the target as link text instead of the raw href, and
  the inserted link stays selected.
* The link balloon shows icon, title and path of the target and
  offers a button to open the link in a new tab.
* Ctrl/Cmd+click and Alt+Enter open the resolved frontend URL
  instead of the unresolvable t3:// link.

Tests ensure the important fallback logic to prevent
information disclosure will be noticed in possible future refactors.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Garvin Hicking +1
    • Josua Vogel +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Garvin Hicking +1
    • Josua Vogel +1
    • core-ci +1 CI

Issues 3

Files 24

Show 4 more files

Review log 1519

  1. Benni Mack uploaded patch set 1 09/23/26, 18:59

  2. core-ci voted on patch set 1 V +1 09/23/26, 19:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109104

  3. Garvin Hicking commented on patch set 1 09/25/26, 13:51

    The link badge can grow too large, and clicking on the preview icon will make it "jump" to the right then. Also the badge contains redundant info for me: ``` <span class="ck-link-toolbar__preview-text"> <span class="ck-link-toolbar__preview-title">Camino Route Comparison</span> <span class="ck-link-toolbar__preview-path">/Newmino/Camino/Camino Route Comparison/</span></span> ``` So the path already contains the title too - it isn't visually distinguished either. Since place is scarce in the badge, I'd probably only show the page title itself, not the path to it? The path could be revealed in the title tooltip (with the uid) only?
  4. Garvin Hicking commented on patch set 1 09/25/26, 13:54

    If I link to a folder, the "open in tab" function opens nothing, the screen only flashes and nothing happens. Probably, a folder link cannot be opened for a preview?
  5. Garvin Hicking commented on patch set 1 09/25/26, 14:22

    LinkPreviewController.php:72

    ```suggestion } catch (\Throwable) { return new JsonResponse($result); } ``` this would add more fallback exceptions for cases like: ``` - ?href=t3://url?url[]=x → parse_str yields an array → UrlLinkHandler::addHttpSchemeAsFallback(array) → TypeError (strict_types). - ?href=t3://email?email[]=x → parse_url(array) → TypeError. - ?href=t3://folder?storage=1&identifier=/../etc/ → LocalDriver → InvalidPathException (AbstractHierarchicalFilesystemDriver.php:50), which extends TYPO3\CMS\Core\Resource\Exception → \Exception ```
  6. Garvin Hicking commented on patch set 1 09/25/26, 14:24

    LinkPreviewController.php:149

    This might disclose/leak record infos, depending on implementations. I'm unsure how to gate this properly though.
  7. Garvin Hicking commented on patch set 1 09/25/26, 14:24

    link-resolver.ts:1

    This file is missing the GPL header. (does TYPO3-dev-companion have that as a rule already?)
  8. Garvin Hicking uploaded patch set 2 V +1 09/25/26, 14:44

    more tests
  9. core-ci voted on patch set 2 V +1 09/25/26, 14:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109254

  10. Benni Mack uploaded patch set 3 V +1 09/25/26, 16:29

  11. Benni Mack uploaded patch set 4 09/25/26, 16:35

  12. Benni Mack commented on patch set 4 09/25/26, 16:37

    Reply

    Done

    Reply

    Done

    link-resolver.ts:1 Reply

    Done

    LinkPreviewController.php:72 Reply

    Done

    LinkPreviewController.php:149 Reply

    Done
  13. core-ci voted on patch set 3 V +1 09/25/26, 16:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109270

  14. core-ci voted on patch set 4 V +1 09/25/26, 16:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109272

  15. Garvin Hicking voted on patch set 4 CR +1 V +1 09/25/26, 18:18

  16. Josua Vogel voted on patch set 4 V +1 09/26/26, 10:14

  17. Josua Vogel voted on patch set 4 CR +1 09/26/26, 10:20

  18. Georg Ringer voted on patch set 4 CR +2 V +2 09/28/26, 19:45

  19. Georg Ringer merged patch set 5 09/28/26, 19:45