summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class7
1 files changed, 5 insertions, 2 deletions
diff --git a/it.class b/it.class
index 32b6a13..9d43983 100644
--- a/it.class
+++ b/it.class
@@ -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();