Skip to content

Commit

Permalink
Merge branch 'MDL-66104_36' of git://github.com/stronk7/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_36_STABLE
  • Loading branch information
junpataleta committed Aug 12, 2019
2 parents 0f07f03 + a588974 commit 9f4959b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/tests/htmlpurifier_test.php
Expand Up @@ -64,6 +64,11 @@ public function test_nolink() {
$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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/weblib.php
Expand Up @@ -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.
Expand Down

0 comments on commit 9f4959b

Please sign in to comment.