Skip to content

Commit 7c83b9e

Browse files
committed
Changed appendXML with createElement for text translation to avoid html entity parsing errors #142
1 parent 42aaf6d commit 7c83b9e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

system/vtpl/vtpl.php

+6
Original file line numberDiff line numberDiff line change
@@ -1956,11 +1956,17 @@ function ($matches) {
19561956
$trimmed = addcslashes($trimmed, "'");
19571957

19581958
if (strlen($trimmed) < 1024) {
1959+
/*
19591960
$php = '<_script language="php"><![CDATA[ echo ' . $this->translationFunction . '(\'' . $trimmed . '\');]]></_script>';
19601961
//keep space around text for html spacing
19611962
$php = str_replace($trimmed, $php, $text);
19621963
$f = $this->document->createDocumentFragment();
19631964
$f->appendXML($php);
1965+
*/
1966+
$c = $this->document->createCDATASection('echo ' . $this->translationFunction . '(\'' . $trimmed . '\');');
1967+
$f = $this->document->createElement('_script');
1968+
$f->setAttribute('language', 'php');
1969+
$f->append($c);
19641970
$node = $node->parentNode->replaceChild($f, $node);
19651971
}
19661972
//$node->parentNode->replaceChild($f, $node);

0 commit comments

Comments
 (0)