-
Improvement
-
Resolution: Fixed
-
Trivial
-
3.0.11
-
None
-
PHP 5.3.8
Right now we have in /includes/functions_template.php in function compile_var_tags() the ability to prefix a template variable with LA_ to mask/encode the output for a JavaScript string:
// Handle addslashed language variables prefixed with LA_
|
// If a template variable already exist, it will be used in favor of it...
|
if (strpos($text_blocks, '{LA_') !== false)
|
{
|
$text_blocks = preg_replace('#\{LA_([A-Z0-9\-_]+)\}#', "<?php echo ((isset(\$this->_rootref['LA_\\1'])) ? \$this->_rootref['LA_\\1'] : ((isset(\$this->_rootref['L_\\1'])) ? addslashes(\$this->_rootref['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ \\1 }'))); ?>", $text_blocks);
|
}
|
My suggestion:
// Handle URL encoded language variables prefixed with LU_
|
// If a template variable already exist, it will be used in favor of it...
|
if (strpos($text_blocks, '{LU_') !== false)
|
{
|
$text_blocks = preg_replace('#\{LU_([A-Z0-9\-_]+)\}#', "<?php echo ((isset(\$this->_rootref['LU_\\1'])) ? \$this->_rootref['LU_\\1'] : ((isset(\$this->_rootref['L_\\1'])) ? urlencode(\$this->_rootref['L_\\1']) : ((isset(\$user->lang['\\1'])) ? urlencode(\$user->lang['\\1']) : '{ \\1 }'))); ?>", $text_blocks);
|
}
|