From 4a3425b31be0e121d69e71fbd5fb8a9dba877426 Mon Sep 17 00:00:00 2001 From: andrey Date: Sun, 22 Apr 2001 21:41:43 +0000 Subject: [PATCH] Fix variable parsing. --- misc/fix_vars.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/misc/fix_vars.php b/misc/fix_vars.php index e6372ecb..eeb75b6e 100644 --- a/misc/fix_vars.php +++ b/misc/fix_vars.php @@ -25,9 +25,9 @@ foreach (array_slice($argv, 1) as $template) { } if (function_exists("preg_replace_callback")) - $output = preg_replace_callback('!\$(\w+(\.\w+)?/)*\w+(?>\.\w+)*(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*!', 'fix_var', $input); + $output = preg_replace_callback('!\$(\w+(\.\w+)?/)*\w+(?>\.\w+)*(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|\s]+))*)*!s', '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 . '|[^|\s]+))*)*!mF', 'fix_var', $input); fwrite($fp, $output); fclose($fp); @@ -55,6 +55,9 @@ function fix_var($match) if (count($props)) $output .= ".".implode('.', $props); + if ($modifiers) + $output .= '|' . $modifiers; + return $output; }