Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Fixed translation text issues with special characters https://github.com/givanz/Vvveb/issues/142

givanza53a2f354f83
diff --git a/system/vtpl/vtpl.php b/system/vtpl/vtpl.php
index ec00882..2a63ebb 100755
--- a/system/vtpl/vtpl.php
+++ b/system/vtpl/vtpl.php
@@ -1983,7 +1983,33 @@ class Vtpl {
$f = $this->document->createElement('_script');
$f->setAttribute('language', 'php');
$f->appendChild($c);
- $node = $node->parentNode->replaceChild($f, $node);
+ $node->parentNode->replaceChild($f, $node);
+
+ //add previously trimmed space around text
+ $space = str_replace($trimmed, '|', $text);
+ $explode = explode('|', $space);
+ //space before text
+ if ($explode[0]) {
+ $s = $this->document->createTextNode($explode[0]);
+ $f->parentNode->insertBefore($s, $f);
+ }
+ //space after text
+ if (isset($explode[1]) && $explode[1]) {
+ $e = $this->document->createTextNode($explode[1]);
+ //php 8
+ if (isset($f->nextElementSibling) && $f->nextElementSibling) {
+ //add before next element
+ $f->parentNode->insertBefore($e, $f->nextSibling);
+ } else {
+ if ($f->nextSibling) {
+ //add before next element
+ $f->parentNode->insertBefore($e, $f->nextSibling);
+ } else {
+ //add as last element
+ $f->parentNode->appendChild($e);
+ }
+ }
+ }
}
//$node->parentNode->replaceChild($f, $node);
} else {