mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 19:34:27 +02:00
fix problem with 4.0.5-dev and preg_replace_callback
This commit is contained in:
@@ -24,6 +24,9 @@ foreach (array_slice($argv, 1) as $template) {
|
|||||||
die("\nError: could not open $template.out for writing\n\n");
|
die("\nError: could not open $template.out for writing\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (function_exists("preg_replace_callback"))
|
||||||
|
$output = preg_replace_callback('!\$(\w+(\.\w+)?/)*\w+(?>\.\w+)*(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*!', 'fix_var', $input);
|
||||||
|
else
|
||||||
$output = preg_replace('!\$(\w+(\.\w+)?/)*\w+(?>\.\w+)*(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*!F', 'fix_var', $input);
|
$output = preg_replace('!\$(\w+(\.\w+)?/)*\w+(?>\.\w+)*(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*!F', 'fix_var', $input);
|
||||||
|
|
||||||
fwrite($fp, $output);
|
fwrite($fp, $output);
|
||||||
|
Reference in New Issue
Block a user