aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2011-10-13 18:03:53 +0000
committerrvelices <rv-github@modusoptimus.com>2011-10-13 18:03:53 +0000
commit3af2b3b0043adca43b5206952253cc302c796e1b (patch)
tree941dddea3650979eed6e67c5429661c7be0ffe95 /include
parent9184ad6bd2616ebe82ad8ea2afe14cf12662dbe7 (diff)
bug 2469 (merge from trunk) compiled_template_cache_language option does not work properly on some language keys because of double escaping
git-svn-id: http://piwigo.org/svn/branches/2.3@12428 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/template.class.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/template.class.php b/include/template.class.php
index 37c2d59e3..92f78a3d6 100644
--- a/include/template.class.php
+++ b/include/template.class.php
@@ -766,13 +766,13 @@ var s,after = document.getElementsByTagName(\'script\')[document.getElementsByTa
$rdq = preg_quote($smarty->right_delimiter, '~');
$regex = "~$ldq *\'([^'$]+)\'\|@translate *$rdq~";
- $source = preg_replace( $regex.'e', 'isset($lang[\'$1\']) ? $lang[\'$1\'] : \'$0\'', $source);
+ $source = preg_replace_callback( $regex, create_function('$m', 'global $lang; return isset($lang[$m[1]]) ? $lang[$m[1]] : $m[0];'), $source);
$regex = "~$ldq *\'([^'$]+)\'\|@translate\|~";
- $source = preg_replace( $regex.'e', 'isset($lang[\'$1\']) ? \'{\'.var_export($lang[\'$1\'],true).\'|\' : \'$0\'', $source);
+ $source = preg_replace_callback( $regex, create_function('$m', 'global $lang; return isset($lang[$m[1]]) ? \'{\'.var_export($lang[$m[1]],true).\'|\' : \'$m[0]\';'), $source);
$regex = "~($ldq *assign +var=.+ +value=)\'([^'$]+)\'\|@translate~e";
- $source = preg_replace( $regex, 'isset($lang[\'$2\']) ? \'$1\'.var_export($lang[\'$2\'],true) : \'$0\'', $source);
+ $source = preg_replace_callback( $regex, create_function('$m', 'global $lang; return isset($lang[$m[2]]) ? $m[1].var_export($lang[$m[2]],true) : \'$m[0]\';'), $source);
return $source;
}