Issue Bug Closed

#105331Target _blank is incorrectly added to relative internal links/deeplinks

Patrick Lenk 10/17/24, 08:16 updated 12/02/25, 14:32

Description

After the upgrade from TYPO3 v11 to v12, target="_blank" is incorrectly added to relative deeplinks.

RTE ckeditor source:

<p>
    <a href="/kontakt/">Deeplink with relative url</a>
</p>
<p>
    <a href="t3://page?uid=1234">Deeplink with t3 scheme</a>
</p>
<p>
    <a href="https://typo3.org/">External Link</a>
</p>

+*Rendered frontend source:*+
(with config.forceAbsoluteUrls = 0 or lib.parseFunc_RTE.tags.a.typolink.forceAbsoluteUrl = 0)

<p>
    <a href="/kontakt/" target="_blank">Deeplink with relative url</a>
</p>
<p>
    <a href="/kontakt/">Deeplink with t3 scheme</a>
</p>
<p>
    <a href="https://typo3.org/" target="_blank" rel="noreferrer">External Link</a>
</p>

+*Rendered frontend source:*+
(with config.forceAbsoluteUrls = 1 or lib.parseFunc_RTE.tags.a.typolink.forceAbsoluteUrl = 1)

<p>
    <a href="https://mysite.localhost/kontakt/" target="_blank">Deeplink with relative url</a>
</p>
<p>
    <a href="https://mysite.localhost/kontakt/">Deeplink with t3 scheme</a>
</p>
<p>
    <a href="https://typo3.org/" target="_blank" rel="noreferrer">External Link</a>
</p>

Reviews 3

History 916

  1. Patrick Lenk changed subject Target _blank is incorrectly added to relative deeplinks Target _blank is incorrectly added to relative internal links/deeplinks category Tags rte, ckeditor, relative, links, deelinks rte, ckeditor, relative, internal, links, deelinks <span data-processor="relativetime" data-value="2024-10-18T08:45:12+00:00" > 10/18/24, 08:45 </span>

  2. Patrick Lenk commented <span data-processor="relativetime" data-value="2024-10-23T12:32:53+00:00" > 10/23/24, 12:32 </span>

    Relative internal-links/ without the leading / are working as excpeted and does not have the target _blank. So it seems that in TYPO3 v12 /relative-link/ is handled as an absolute link.

  3. Julian Mair commented <span data-processor="relativetime" data-value="2025-01-27T15:05:55+00:00" > 01/27/25, 15:05 </span>

    I can confirm that this also happens in Typo3 v13

  4. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-03-17T08:40:09+00:00" > 03/17/25, 08:40 </span>

    Applied in changeset commit:5ebafcc18de77fbab35a57c687faf0c694bbf6fd.

  5. Patrick Lenk commented <span data-processor="relativetime" data-value="2025-03-17T12:49:52+00:00" > 03/17/25, 12:49 </span>

    Georg Ringer wrote in #note-9:
    > Applied in changeset commit:5ebafcc18de77fbab35a57c687faf0c694bbf6fd.

    please add a patch also for 12.4. many thanks!

  6. Gerrit Code Review pushed patch set 1 for 12.4 to change 88615 status Resolved Under Review <span data-processor="relativetime" data-value="2025-03-17T13:18:16+00:00" > 03/17/25, 13:18 </span>

  7. Georg Ringer commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2025-03-17T14:00:09+00:00" > 03/17/25, 14:00 </span>

    Applied in changeset commit:2c654808d639bacce090585415bf36c3497535a3.

  8. Patrick Lenk commented <span data-processor="relativetime" data-value="2025-03-19T16:07:37+00:00" > 03/19/25, 16:07 </span>

    Georg Ringer wrote in #note-13:
    > patrick merged in 12 as well

    Thanks. Unfortunately, the bug does not seem to have been fixed, at least for the scenario I reported above. Relative links with leading / in ckeditor.
    For link fields such as header_link, the incorrect target _blank is only not added if config.forceAbsoluteUrls = 0. With config.forceAbsoluteUrls = 1 _blank is still added.