Issue Bug Resolved

#95878In linkvalidator, soft reference parser extracts 2 links from rich text with URL as anchor text

Sybille Peters 11/05/21, 07:55 updated 09/23/26, 12:35

Description

This used to work fine. This seems to be not a bug in linkvalidator but due to a change in link parsing!

Reproduce

1. Create a CE (e.g. textmedia) and create a link in the bodytext (RTE) using an URL as link text (e.g. http://localhost/i-am-broken)
2. The generated code in RTE will be like <a href="http://localhost/i-am-broken">http://localhost/i-am-broken</a>
3. Execute “Check links” in “Info” > “Linkvalidator” > “Check links” tab

linkvalidator_rte.png

The problem does not occur, if it is just the URL in RTE, not with link markup:

linkvalidator_rte2.png

Actual result

2 Broken link records will be displayed for this broken link

linkvalidator_result.png

Expected result

Only one record should be displayed for 1 broken link.

Reason of problem

Since there are several softrefparsers for the field ($conf['softref'] = 'typolink_tag,email[subst],url') the text is parsed several times and if there is a match, this part is not removed (which it probably should).

Result:

$conf['softref'] = 'typolink_tag,email[subst],url'

<a href="https://blah">https://blah</a>

(1)
softReferenceParser
 parserKey=typolink_tag

 parserResult:
   matchstring=<a href="https://blah">
   type=external
   tokenValue=https://blah

(2)
 softReferenceParser
  parserKey=url

 parserResult:
    matchString=https://blah
    type=string
    value=https://blah

Reviews 2

Files 3

History 1440

Show 715 earlier messages
  1. Gerrit Code Review pushed patch set 1 for master to change 72057 status New Under Review <span data-processor="relativetime" data-value="2021-11-05T09:00:18+00:00" > 11/05/21, 09:00 </span>

  1. Sybille Peters changed attached linkvalidator_result.png attached linkvalidator_rte.png description <span data-processor="relativetime" data-value="2024-03-15T07:47:56+00:00" > 03/15/24, 07:47 </span>

  2. Sybille Peters commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-23T12:35:15+00:00" > 09/23/26, 12:35 </span>

    Applied in changeset commit:0d991ceb30d5bf4150766a239d2668f2dc04657d.