Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
360e819
)
MDL-54853 weblib: Specify version and fixed encoding
author
Andrew Nicols
<andrew@nicols.co.uk>
Thu, 9 Jun 2016 01:53:48 +0000
(09:53 +0800)
committer
Andrew Nicols
<andrew@nicols.co.uk>
Thu, 9 Jun 2016 01:53:48 +0000
(09:53 +0800)
lib/weblib.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/weblib.php
b/lib/weblib.php
index
1e24072
..
c86dc0e
100644
(file)
--- a/
lib/weblib.php
+++ b/
lib/weblib.php
@@
-1320,9
+1320,8
@@
function format_text($text, $format = FORMAT_MOODLE, $options = null, $courseidd
}
if ($options['blanktarget']) {
}
if ($options['blanktarget']) {
- $encoding = ini_get('default_charset') ? ini_get('default_charset') : 'utf-8';
$domdoc = new DOMDocument();
$domdoc = new DOMDocument();
- $domdoc->loadHTML('<?xml
encoding="' . $encoding . '
" ?>' . $text);
+ $domdoc->loadHTML('<?xml
version="1.0" encoding="UTF-8
" ?>' . $text);
foreach ($domdoc->getElementsByTagName('a') as $link) {
if ($link->hasAttribute('target') && strpos($link->getAttribute('target'), '_blank') === false) {
continue;
foreach ($domdoc->getElementsByTagName('a') as $link) {
if ($link->hasAttribute('target') && strpos($link->getAttribute('target'), '_blank') === false) {
continue;