From 1a3a131b0dffce2cffa17b38ef9e2f7fc1a6d857 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 27 Nov 2009 13:22:51 +0000 Subject: [PATCH] handling parameter-replacements in translation class --- phpgwapi/inc/class.translation.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.translation.inc.php b/phpgwapi/inc/class.translation.inc.php index 85caa7494f..026e6eeb64 100644 --- a/phpgwapi/inc/class.translation.inc.php +++ b/phpgwapi/inc/class.translation.inc.php @@ -187,10 +187,11 @@ class translation { if (count($vars) > 1) { - static $placeholders = array('%2','%1','|%2|','%3','%4','%5','%6','%7','%8','%9','%10'); + static $placeholders = array('%3','%2','%1','|%2|','|%3|','%4','%5','%6','%7','%8','%9','%10'); // 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 - array_unshift($vars,'|%2|'); // push '|%2|' as first replacement on $vars + // we do that for %3 as well, ... + array_unshift($vars,array('|%3|','|%2|')); // push '|%2|' (and such) as first replacement on $vars $ret = str_replace($placeholders,$vars,$ret); } else