Skip to content

Commit

Permalink
Merge pull request #430 from Exile37/bugfix/lang-variables
Browse files Browse the repository at this point in the history
Fixes #412 - bug with dynamic language variables
  • Loading branch information
Exileum committed Jul 29, 2017
2 parents 6eaeab6 + 6af6208 commit 4ec6a3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Legacy/Template.php
Expand Up @@ -774,7 +774,7 @@ public function _compile_text($code)
$code = str_replace($search, $replace, $code);
}
// This will handle the remaining root-level varrefs
$code = preg_replace('#\{(L_([a-z0-9\-_]+?))\}#i', '<?php echo isset($L[\'$2\']) ? $L[\'$2\'] : (isset($SL[\'$2\']) ? $SL[\'$2\'] : \'$2\'); ?>', $code);
$code = preg_replace('#\{(L_([a-z0-9\-_]+?))\}#i', '<?php echo isset($L[\'$2\']) ? $L[\'$2\'] : (isset($SL[\'$2\']) ? $SL[\'$2\'] : $V[\'$1\']); ?>', $code);
$code = preg_replace('#\{(\$[a-z_][a-z0-9_$\->\'\"\.\[\]]*?)\}#i', '<?php echo isset($1) ? $1 : \'\'; ?>', $code);
$code = preg_replace('#\{(\#([a-z_][a-z0-9_]*?))\}#i', '<?php echo defined(\'$2\') ? $2 : \'\'; ?>', $code);
$code = preg_replace('#\{([a-z0-9\-_]+?)\}#i', '<?php echo isset($V[\'$1\']) ? $V[\'$1\'] : \'\'; ?>', $code);
Expand Down

0 comments on commit 4ec6a3e

Please sign in to comment.