Merge branch 'MDL-66104_37' of git://github.com/stronk7/moodle into MOODLE_37_STABLE

This commit is contained in:
Jun Pataleta
2019-08-12 14:51:52 +08:00
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -64,6 +64,11 @@ class core_htmlpurifier_testcase extends basic_testcase {
$text = '<nolink>xxx<em>xx</em><div>xxx</div></nolink>';
$result = purify_html($text, array());
$this->assertSame($text, $result);
// Ensure nolink doesn't force open tags to be closed, so can be virtually everywhere.
$text = '<p><nolink><div>no filters</div></nolink></p>';
$result = purify_html($text, array());
$this->assertSame($text, $result);
}
/**
+1 -1
View File
@@ -1856,7 +1856,7 @@ function purify_html($text, $options = array()) {
}
if ($def = $config->maybeGetRawHTMLDefinition()) {
$def->addElement('nolink', 'Block', 'Flow', array()); // Skip our filters inside.
$def->addElement('nolink', 'Inline', 'Flow', array()); // Skip our filters inside.
$def->addElement('tex', 'Inline', 'Inline', array()); // Tex syntax, equivalent to $$xx$$.
$def->addElement('algebra', 'Inline', 'Inline', array()); // Algebra syntax, equivalent to @@xx@@.
$def->addElement('lang', 'Block', 'Flow', array(), array('lang'=>'CDATA')); // Original multilang style - only our hacked lang attribute.