From a3feb49a21e9366bb3ae42d43703c3f04c879232 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 28 Nov 2009 11:33:28 +0000 Subject: [PATCH] fixed replacement of multiple placeholders --- phpgwapi/inc/class.translation.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.translation.inc.php b/phpgwapi/inc/class.translation.inc.php index c864b0cb94..3ad1a0d23c 100644 --- a/phpgwapi/inc/class.translation.inc.php +++ b/phpgwapi/inc/class.translation.inc.php @@ -226,7 +226,7 @@ class translation // to cope with $vars[0] containing '%2' (eg. an urlencoded path like a referer), // we first replace '%2' in $ret with '|%2|' and then use that as 2. placeholder // we do that for %3 as well, ... - array_unshift($vars,array('|%3|','|%2|')); // push '|%2|' (and such) as first replacement on $vars + $vars = array_merge(array('|%3|','|%2|'),$vars); // push '|%2|' (and such) as first replacement on $vars $ret = str_replace($placeholders,$vars,$ret); } else @@ -1174,3 +1174,8 @@ class translation } } } +/* +$msg = 'Bitte %1hier%2 clicken!'; +$replace = array('',''); +echo "

".htmlspecialchars(translation::translate($msg,$replace))."

\n"; +*/ \ No newline at end of file