]> git.mxchange.org Git - mailer.git/blobdiff - inc/template-functions.php
Possible fix for bad escaping of single-quotes
[mailer.git] / inc / template-functions.php
index 768cf677c45cb627d5372797c3281dc2222a60fd..e29ca2856e1dabe47ab7ecead182b85a0d73ada8 100644 (file)
@@ -242,7 +242,7 @@ function doFinalCompilation ($code, $insertComments = true) {
                // Compile it
                //* DEBUG: */ debugOutput('<pre>'.encodeEntities($code).'</pre>');
                $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code))) . '";';
-               //* DEBUG: */ if ($insertComments) die('<pre>'.linenumberCode($eval).'</pre>');
+               //* DEBUG: */ if (!$insertComments) print('<pre>'.linenumberCode($eval).'</pre>');
                eval($eval);
                //* DEBUG: */ die('<pre>'.encodeEntities($newContent).'</pre>');
 
@@ -1450,6 +1450,9 @@ function escapeQuotes ($str, $single = false) {
                // Escape all (including null)
                $str = addslashes($str);
        } else {
+               // Remove escaping of single quotes
+               $str = str_replace("\'", "'", $str);
+
                // Escape only double-quotes but prevent double-quoting
                $str = str_replace("\\\\", "\\", str_replace('"', "\\\"", $str));
        }