Issue Bug Resolved

#97937Linkvalidator: Links and   in tt_content.bodytext cause problems in UrlSoftReferenceParser

Kai Strecker 07/14/22, 09:55 updated 11/19/26, 10:40

Description

In our test case, we have a content element with CType = textmedia and the following data in the bodytext field:

<p>lorem ipsum https://weber.digital&nbsp; &nbsp; dolor sit amet</p>
<p><strong>Used Fonts and Iconfonts</strong><br /> Museo Sans Rounded Family OTF (<a class="external" href="https://www.myfonts.com">https://www.myfonts.com</a>)<br /> Droid Serif (<a class="external" href="https://www.fontsquirrel.com/fonts/droid-serif">https://www.fontsquirrel.com/fonts/droid-serif</a>)<br /> Icons Mind (<a class="external" href="https://iconsmind.com">https://iconsmind.com</a>)<br /> Linear Icons Free (<a class="external" href="https://linearicons.com">https://linearicons.com</a>) (CC BY-SA 4.0) by Perxis (<a class="external" href="https://perxis.com">https://perxis.com</a>)</p>
When the linkvalidator executes the UrlSoftReferenceParser, it finds two broken links:

So according to this test, the UrlSoftReferenceParser does not handle &nbsp; correctly and also has a bug in the big regex, which does all the parsing.

Reviews 3

History 828

Show 03 earlier messages
  1. Sybille Peters commented <span data-processor="relativetime" data-value="2022-09-22T05:55:21+00:00" > 09/22/22, 05:55 </span>

    Has anyone analyzed this further what actually causes the problem, what is affected and what is not and would work as a workaround ?

    I have tested the following and it works – meaning the linkvalidator BE module will now show the broken links, but some of my workarounds are a bit brutal, so you should make sure, it is what you want.

    Analysis

    The affected texts mostly contained an URL as anchor text. When this was changed, the problem no longer existed.

    Possible work-arounds

    Solution 3 is the least invasive, it only affects link checking, the other 2 also change the content / behaviour of TYPO3 in general.

    1. If possible, do not use URLs as anchor texts. This has some disadavantages in general, so it might be a good idea in general:

    • accessibility / screen readers
    • Usability, SEO: Is the URL really what you want to show the users (in some cases it may be), but often it is better to embed a link in a sentence or word(s) organically which results in text as anchor text, not URLs.

    As makeshift solution, the URL in the anchor text can be converted to an URL without scheme, e.g.

    https://example.org => example.org

    2. Do not parse the rich texts with softref “url”.

    This can be disabled entirely ( !!!which will also result in URLs that are displayed as links no longer being displayed as URLs, so make sure this is what you want!!! ).

    e.g.

    Configuration/TCA/Overrides/tt_content.php

    $GLOBALS[‘TCA’][‘tt_content’][‘columns’][‘bodytext’][‘config’][‘softref’] = preg_replace(‘#(,|^)url(,|$)#’, ‘’,
    $GLOBALS[‘TCA’][‘tt_content’][‘columns’][‘bodytext’][‘config’][‘softref’]);

    which results in:

    - softref = rtehtmlarea_images,typolink_tag,email[subst],url
    + softref = rtehtmlarea_images,typolink_tag,email[subst]

    3. Or it can be disabled only when parsing with linkvalidator (and leaving the rest intact) by patching linkvalidator/Classes/LinkAnalyzer::analyzeRecord(). But this way it will only check links, not standalone URLs.

    if (!($conf['softref'] ?? false) || (string)$valueField === '') {
      continue;
    }
    + $conf['softref'] = preg_replace('#(,|^)url(,|$)#', '', $conf['softref']);
  2. Josef Glatz commented <span data-processor="relativetime" data-value="2026-01-14T16:30:08+00:00" > 01/14/26, 16:30 </span>

    Also TYPO3 13 seems to be affected by this problem.

  3. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-11-19T10:40:10+00:00" > 11/19/26, 10:40 </span>

    Applied in changeset commit:7037252cc07521e5e65f987f7b6ab932c116bc89.