- bugfix shared.literal_compiler_param.php did throw an exception when literal did contain a '-' (smarty-developers group)

This commit is contained in:
Uwe.Tews@googlemail.com
2014-02-05 19:39:21 +00:00
parent ba2996fef5
commit f242ce30fb
2 changed files with 4 additions and 1 deletions

View File

@@ -23,7 +23,7 @@ function smarty_literal_compiler_param($params, $index, $default=null)
return $default;
}
// test if param is a literal
if (!preg_match('/^([\'"]?)[a-zA-Z0-9]+(\\1)$/', $params[$index])) {
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');
}