Merge branch 'wip-MDL-56899-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE
This commit is contained in:
@@ -1321,7 +1321,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