Issue Bug Closed

#99909False positive broken links by parsing URLs not inside <a> tags

Christian Ludwig 02/09/23, 20:36 updated 12/02/25, 14:33

Description

Linkvalidator always reports an error due to the appearance of “http://” or “https://” in the body text (just text, no href etc.).

Linkvalidator should only check real links not the apparente of link like texts.

In addition it would be grate to have an icon in the “Listing of broken links” next to the pencil that can be clicked to ignore these errors (this link) in future crawlings.

Reviews 3

Files 4

History 1318

  1. Sybille Peters commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2023-08-13T06:28:25+00:00" > 08/13/23, 06:28 </span>

    > Linkvalidator always reports an error due to the appearance of “http://” or “https://” in the body text (just text, no href etc.).

    Can you give an example here and steps to reproduce (preferably reproducible in TYPO3 v13)?

    Do you mean URLs directly in the body text, not enclosed in an tag, such as

    https://example.org/abc

    as opposed to

    <a href="https://example.org/abc">link</a>

    If URLs are parsed as links also depends on how you configured the softref field in TCA.
    For example
    $TCA[‘tt_content’][‘columns’][‘bodytext’][‘config’][‘softref’] = typolink_tag,email[subst],url;

    If you remove the “url” here, URLs in bodytext will no longer be parsed as links.

    Compare also how these URLs are rendered in the Frontend by TYPO3.

    So, depending on your configuration this may be intended and correct behavior.

    I am very well aware that there are still some problems with parsing, but this issue needs a better description.

    See also:

    See also other issues for linkvalidator: https://forge.typo3.org/projects/typo3cms-core/issues?c%5B%5D=tracker&c%5B%5D=status&c%5B%5D=priority&c%5B%5D=subject&c%5B%5D=assigned_to&c%5B%5D=category&c%5B%5D=fixed_version&f%5B%5D=status_id&f%5B%5D=category_id&f%5B%5D=&group_by=&op%5Bcategory_id%5D=%3D&op%5Bstatus_id%5D=o&per_page=50&set_filter=1&sort=id%3Adesc&t%5B%5D=&utf8=%E2%9C%93&v%5Bcategory_id%5D%5B%5D=1493

  2. Sybille Peters commented <span data-processor="relativetime" data-value="2023-08-13T06:31:01+00:00" > 08/13/23, 06:31 </span>

    > In addition it would be grate to have an icon in the “Listing of broken links” next to the pencil that can be clicked to ignore these errors (this link) in future crawlings.

    For excluding specific external URLs there is already an issue: https://forge.typo3.org/issues/85127

    You can also look at my extension “Broken Link Fixer” (brofix) which is a fork of linkvalidator and implements this, see https://extensions.typo3.org/extension/brofix

  3. Sybille Peters commented and changed subject False positive broken links False positive broken links by parsing URLs not inside <a> tags <span data-processor="relativetime" data-value="2023-08-13T06:41:12+00:00" > 08/13/23, 06:41 </span>

    If this issue relates specifically to parsing, I would change the title to differentiate from: https://forge.typo3.org/issues/101670

  4. Christian Ludwig commented and changed attached source-code-from-rendered-page.png <span data-processor="relativetime" data-value="2023-08-30T11:09:30+00:00" > 08/30/23, 11:09 </span>

    In the described case it is simply text, no anchor href. Here the example code from the rendered page as it is shown to the visitor.

    <p>
        ... Eine verschlüsselte Verbindung erkennen Sie daran, dass die Adresszeile des Browsers
        von „http://“ auf „https://“ wechselt und an dem Schloss-Symbol in Ihrer Browserzeile.
    </p>
  5. Sascha Egerer commented <span data-processor="relativetime" data-value="2025-06-03T16:18:21+00:00" > 06/03/25, 16:18 </span>

    Christian Ludwig wrote in #note-9:
    > In the described case it is simply text, no anchor href. Here the example code from the rendered page as it is shown to the visitor.
    > […]

    This code does also break pretty hard.

    
    <a href="t3://page?uid=1">https://domain.tld/aaa/</a>
    
    <a href="t3://page?uid=2">https://www.foo.de/bar/baz/</a>
    
    <ul>
        <li>Foo <a href="t3://page?uid=3">https://www.foo.de/bim/bam/</a></li>
    </ul>
    Foo

    Result of soft reference parse is:

    array(3) {
      [2]=>
      array(1) {
        ["matchString"]=>
        string(23) "https://domain.tld/aaa/"
      }
      [7]=>
      array(1) {
        ["matchString"]=>
        string(5) "https"
      }
      [12]=>
      array(1) {
        ["matchString"]=>
        string(21) "</a></li>
    </ul>
    Foo
     "
      }
    }

    Expected result should contain the 3 link.s

  6. Gerrit Code Review pushed patch set 1 for main to change 89619 status Needs Feedback Under Review <span data-processor="relativetime" data-value="2025-06-03T22:02:49+00:00" > 06/03/25, 22:02 </span>

  7. Sascha Egerer commented <span data-processor="relativetime" data-value="2025-06-04T07:28:47+00:00" > 06/04/25, 07:28 </span>

    I’ve hopefully fixed all of the cases mentioned in the ticket now. Reviews are welcome.

  8. Sascha Egerer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-06-05T11:50:07+00:00" > 06/05/25, 11:50 </span>

    Applied in changeset commit:ccb04d2b7bcb48d2d7fdb19c8e169a6e4599fbb4.