Possible fix for JavaScript templates, don't use escapeQuotes() for them
authorRoland Häder <roland@mxchange.org>
Fri, 6 Nov 2009 15:33:01 +0000 (15:33 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 6 Nov 2009 15:33:01 +0000 (15:33 +0000)
inc/functions.php

index 3a9033a..7ef9f2e 100644 (file)
@@ -294,7 +294,7 @@ function loadTemplate ($template, $return = false, $content = array()) {
                                        $eval = '$ret = "' . compileCode(escapeQuotes($ret)) . '";';
                                } elseif (substr($template, 0, 3) == 'js_') {
                                        // JavaScripts don't like entities and timings
-                                       $eval = '$ret = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['tpl_content'])) . '");';
+                                       $eval = '$ret = decodeEntities("' . compileRawCode(addslashes($GLOBALS['tpl_content'])) . '");';
                                } else {
                                        // Prepare eval() command
                                        $eval = '$ret = "' . compileCode(escapeQuotes($GLOBALS['tpl_content'])) . '";';