Permalink
Browse files

bug 2469 compiled_template_cache_language option does not work proper…

…ly on some language keys because of double escaping

git-svn-id: http://piwigo.org/svn/trunk@12427 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information...
modus75 committed Oct 13, 2011
1 parent 83528a7 commit 143637d30ee2a386b80dbeb6ce6ff44874d1bfd5
@@ -280,7 +280,7 @@ jQuery().ready(function(){ldelim}
<td colspan="2">
<label>
<input type="checkbox" name="newsletter_subscribe"{if $F_NEWSLETTER_SUBSCRIBE} checked="checked"{/if}>
<span class="cluetip" title="{'Piwigo Announcements Newsletter'|@translate}|{'Keep in touch with Piwigo project, subscribe to Piwigo Announcement Newsletter. You will receive emails when a new release is available (sometimes including a security bug fix, it\'s important to know and upgrade) and when major events happen to the project. Only a few emails a year.'|@translate|htmlspecialchars|nl2br}">{'Subscribe %s to Piwigo Announcements Newsletter'|@translate|@sprintf:$EMAIL}</span>
<span class="cluetip" title="{'Piwigo Announcements Newsletter'|@translate}|{'Keep in touch with Piwigo project, subscribe to Piwigo Announcement Newsletter. You will receive emails when a new release is available (sometimes including a security bug fix, it\'s important to know and upgrade) and when major events happen to the project. Only a few emails a year.'|@translate|@htmlspecialchars|@nl2br}">{'Subscribe %s to Piwigo Announcements Newsletter'|@translate|@sprintf:$EMAIL}</span>
</label>
<br>
</td>
@@ -1,8 +1,8 @@
{combine_script id='jquery.cluetip' load='async' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'}

{footer_script require='jquery.cluetip'}
var piwigo_need_update_msg = '<a href="admin.php?page=updates">{"A new version of Piwigo is available."|@translate|@escape:"javascript"}</a>';
var ext_need_update_msg = '<a href="admin.php?page=updates&amp;tab=ext">{"Some upgrades are available for extensions."|@translate|@escape:"javascript"}</a>';
var piwigo_need_update_msg = '<a href="admin.php?page=updates">{'A new version of Piwigo is available.'|@translate|@escape:"javascript"}</a>';
var ext_need_update_msg = '<a href="admin.php?page=updates&amp;tab=ext">{'Some upgrades are available for extensions.'|@translate|@escape:"javascript"}</a>';

{literal}
jQuery().ready(function(){
@@ -42,7 +42,7 @@ jQuery().ready(function(){
<li><a href="{$PHPWG_URL}" class="externalLink">Piwigo</a> {$PWG_VERSION}</li>
<li><a href="{$U_CHECK_UPGRADE}">{'Check for upgrade'|@translate}</a></li>
{if isset($SUBSCRIBE_BASE_URL)}
<li><a href="{$SUBSCRIBE_BASE_URL}{$EMAIL}" class="externalLink cluetip" title="{'Piwigo Announcements Newsletter'|@translate}|{'Keep in touch with Piwigo project, subscribe to Piwigo Announcement Newsletter. You will receive emails when a new release is available (sometimes including a security bug fix, it\'s important to know and upgrade) and when major events happen to the project. Only a few emails a year.'|@translate|htmlspecialchars|nl2br}">{'Subscribe %s to Piwigo Announcements Newsletter'|@translate|@sprintf:$EMAIL}</a></li>
<li><a href="{$SUBSCRIBE_BASE_URL}{$EMAIL}" class="externalLink cluetip" title="{'Piwigo Announcements Newsletter'|@translate}|{'Keep in touch with Piwigo project, subscribe to Piwigo Announcement Newsletter. You will receive emails when a new release is available (sometimes including a security bug fix, it\'s important to know and upgrade) and when major events happen to the project. Only a few emails a year.'|@translate|@htmlspecialchars|@nl2br}">{'Subscribe %s to Piwigo Announcements Newsletter'|@translate|@sprintf:$EMAIL}</a></li>
{/if}
</ul>
</dd>
@@ -26,8 +26,8 @@ jQuery().ready(function(){ldelim}
</thead>
{foreach from=$languages item=language name=languages_loop}
<tr class="{if $smarty.foreach.languages_loop.index is odd}row1{else}row2{/if}">
<td><a href="{$language.EXT_URL}" class="externalLink cluetip" title="{$language.EXT_NAME}|{$language.EXT_DESC|htmlspecialchars|nl2br}">{$language.EXT_NAME}</a></td>
<td style="text-align:center;"><a href="{$language.EXT_URL}" class="externalLink cluetip" title="{$language.EXT_NAME}|{$language.VER_DESC|htmlspecialchars|nl2br}">{$language.VERSION}</a></td>
<td><a href="{$language.EXT_URL}" class="externalLink cluetip" title="{$language.EXT_NAME}|{$language.EXT_DESC|@htmlspecialchars|@nl2br}">{$language.EXT_NAME}</a></td>
<td style="text-align:center;"><a href="{$language.EXT_URL}" class="externalLink cluetip" title="{$language.EXT_NAME}|{$language.VER_DESC|@htmlspecialchars|@nl2br}">{$language.VERSION}</a></td>
<td>{$language.DATE}</td>
<td>{$language.AUTHOR}</td>
<td style="text-align:center;"><a href="{$language.URL_INSTALL}">{'Install'|@translate}</a>
@@ -26,7 +26,7 @@ jQuery(document).ready(function(){
{/literal}{/footer_script}

<div class="titrePage">
<h2>{'Menu Management'|translate}</h2>
<h2>{'Menu Management'|@translate}</h2>
</div>

<form id="menuOrdering" action="{$F_ACTION}" method="post">
@@ -186,7 +186,7 @@ checkFieldsets();
<tr>
<td></td>
<td class="pluginDesc">
<p id="revdesc_{$plugin.ID}" style="display:none;">{$plugin.REV_DESC|htmlspecialchars|nl2br}</p>
<p id="revdesc_{$plugin.ID}" style="display:none;">{$plugin.REV_DESC|@htmlspecialchars|@nl2br}</p>
</td>
</tr>
</table>
@@ -228,7 +228,7 @@ checkFieldsets();
<tr>
<td></td>
<td class="pluginDesc">
<p id="revdesc_{$theme.ID}" style="display:none;">{$theme.REV_DESC|htmlspecialchars|nl2br}</p>
<p id="revdesc_{$theme.ID}" style="display:none;">{$theme.REV_DESC|@htmlspecialchars|@nl2br}</p>
</td>
</tr>
</table>
@@ -270,7 +270,7 @@ checkFieldsets();
<tr>
<td></td>
<td class="pluginDesc">
<p id="revdesc_{$language.ID}" style="display:none;">{$language.REV_DESC|htmlspecialchars|nl2br}</p>
<p id="revdesc_{$language.ID}" style="display:none;">{$language.REV_DESC|@htmlspecialchars|@nl2br}</p>
</td>
</tr>
</table>
@@ -766,13 +766,13 @@ static function prefilter_language($source, &$smarty)
$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;
}

0 comments on commit 143637d

Please sign in to comment.