MDL-68738 wiki: Prevent URLs inside links from turning into another link
commite67a6060e098572b6bc18cae07ee04913a30bfa3
authorDavid Mudrák <david@moodle.com>
Tue, 19 May 2020 21:01:16 +0000 (19 23:01 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Thu, 21 May 2020 19:12:42 +0000 (21 21:12 +0200)
tree2bb396e05381e8a49a2b9442cccc1f0937b5afb5
parent0aadca7a48af0676d52f78af12702db963f1ec2b
MDL-68738 wiki: Prevent URLs inside links from turning into another link

There was a problem with wiki pages in the HTML markup syntax. If they
contain a link and the link text has a URL in it, that URL was converted
into another link. But it was not correctly nested and it caused
additional troubles with filters (particularly the multimedia filter if
the URL was a video such as on youtube).

The solution here is similar to what we do in filters. We protect the
whole explicit link so that its content is not further parsed. That
prevents the inner URL to be converted into another link and the
explicit link has the full control.
mod/wiki/parser/markups/html.php
mod/wiki/tests/wikiparser_test.php