MDL-68738 wiki: Prevent URLs inside links from turning into another link
commit59641dd5a661774df97ddbd474b86d17fb675bb8
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:02 +0000 (21 21:12 +0200)
tree5553688626ab8677dd8f14a578e5724df411039a
parente50e6d39ce931e9ebca453d2fd44547479b6daf3
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