MDL-59125 filter_urltolink: ignoretags on nolink span

This commit is contained in:
Mark Sharp 2017-06-05 09:41:42 +01:00 committed by Marina Glancy
parent 4c6063bff9
commit 2a477bf08e

View File

@ -73,8 +73,8 @@ class filter_urltolink extends moodle_text_filter {
//<a href="blah">
//&lt;a href="blah"&gt;
//&lt;a href="blah">
$filterignoretagsopen = array('<a\s[^>]+?>');
$filterignoretagsclose = array('</a>');
$filterignoretagsopen = array('<a\s[^>]+?>', '<span[^>]+?class="nolink"[^>]*?>');
$filterignoretagsclose = array('</a>', '</span>');
filter_save_ignore_tags($text,$filterignoretagsopen,$filterignoretagsclose,$ignoretags);
// Check if we support unicode modifiers in regular expressions. Cache it.
@ -174,4 +174,3 @@ function filter_urltolink_img_callback($link) {
}
return '<img class="filter_urltolink_image" alt="" src="'.$link[1].'" />';
}