From 6c1f963aee2964f8fb3736d18689afeea1f0c34a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 28 Nov 2009 11:32:56 +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 026e6eeb64..8e4e16596c 100644 --- a/phpgwapi/inc/class.translation.inc.php +++ b/phpgwapi/inc/class.translation.inc.php @@ -191,7 +191,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 @@ -842,3 +842,8 @@ class translation return $this->db->select($this->lang_table,'message_id',$where,__LINE__,__FILE__)->fetchColumn(); } } +/* +$msg = 'Bitte %1hier%2 clicken!'; +$replace = array('',''); +echo "

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

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