diff options
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -425,8 +425,9 @@ function exec(/* $cmd, $values1 = array(), ... */) #for escapeshellarg in it::_exec_quotevalue $oldlocale = setlocale(LC_CTYPE, 0); setlocale(LC_CTYPE, 'de_CH'); - while (list($tag, $option, $key) = it::match('({(-?)(\w+)})', $cmd)) + foreach (it::match('({(-?)([a-z]\w*)})', $cmd, array('all' => true)) as $tags) { + list($tag, $option, $key) = $tags; $parts = array(); if ($option) @@ -445,8 +446,10 @@ function exec(/* $cmd, $values1 = array(), ... */) $parts[] = it::_exec_quotevalue($value); } - $cmd = str_replace($tag, join(" ", $parts), $cmd); + $replacements[$tag] = join(" ", $parts); } + + $cmd = strtr($cmd, (array)$replacements); # Use strtr behaviour of going through source string once setlocale(LC_CTYPE, $oldlocale); $s = gettimeofday(); |