Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
2f3ae73a
Commit
2f3ae73a
authored
Nov 15, 2016
by
David Monllaó
Committed by
Dan Poltawski
Nov 15, 2016
Browse files
Merge branch 'wip-MDL-56899-master' of
git://github.com/marinaglancy/moodle
parents
04fbba05
f31e1e8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/weblib.php
View file @
2f3ae73a
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment