Merge branch 'wip-MDL-56899-master' of git://github.com/marinaglancy/moodle
This commit is contained in:
@@ -1319,7 +1319,9 @@ function format_text($text, $format = FORMAT_MOODLE, $options = null, $courseidd
|
||||
|
||||
if ($options['blanktarget']) {
|
||||
$domdoc = new DOMDocument();
|
||||
libxml_use_internal_errors(true);
|
||||
$domdoc->loadHTML('<?xml version="1.0" encoding="UTF-8" ?>' . $text);
|
||||
libxml_clear_errors();
|
||||
foreach ($domdoc->getElementsByTagName('a') as $link) {
|
||||
if ($link->hasAttribute('target') && strpos($link->getAttribute('target'), '_blank') === false) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user