mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-28 19:01:37 +01:00
- reformat all code for unique style
This commit is contained in:
@@ -20,16 +20,17 @@
|
||||
function smarty_literal_compiler_param($params, $index, $default = null)
|
||||
{
|
||||
// not set, go default
|
||||
if (!isset($params[$index])) {
|
||||
if (!isset($params[ $index ])) {
|
||||
return $default;
|
||||
}
|
||||
// test if param is a literal
|
||||
if (!preg_match('/^([\'"]?)[a-zA-Z0-9-]+(\\1)$/', $params[$index])) {
|
||||
throw new SmartyException('$param[' . $index . '] is not a literal and is thus not evaluatable at compile time');
|
||||
if (!preg_match('/^([\'"]?)[a-zA-Z0-9-]+(\\1)$/', $params[ $index ])) {
|
||||
throw new SmartyException('$param[' . $index .
|
||||
'] is not a literal and is thus not evaluatable at compile time');
|
||||
}
|
||||
|
||||
$t = null;
|
||||
eval("\$t = " . $params[$index] . ";");
|
||||
eval("\$t = " . $params[ $index ] . ";");
|
||||
|
||||
return $t;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user