MDL-79360 filter: fix nolink tag regression from MDL-77525

This commit is contained in:
Petr Skoda
2023-09-15 12:44:37 +02:00
parent d6f0c937ba
commit cf424224d1
2 changed files with 42 additions and 2 deletions
+4 -2
View File
@@ -228,8 +228,10 @@ class filter_manager {
public function filter_text($text, $context, array $options = array(),
array $skipfilters = null) {
$text = $this->apply_filter_chain($text, $this->get_text_filters($context), $options, $skipfilters);
// Remove <nolink> tags for XHTML compatibility.
$text = str_replace(array('<nolink>', '</nolink>'), '', $text);
if (!isset($options['stage']) || $options['stage'] === 'post_clean') {
// Remove <nolink> tags for XHTML compatibility after the last filtering stage.
$text = str_replace(array('<nolink>', '</nolink>'), '', $text);
}
return $text;
}