R28155 - /branches/1.6/phpgwapi/inc/class.translation.inc.php

Author: ralfbecker
New Revision: 28155

URL: http://www.egroupware.org/viewvc/egroupware?rev=28155&view=rev
Log:
“fix to cope with $vars[0] containing ‘%2’ in lang() calls”

Modified:
branches/1.6/phpgwapi/inc/class.translation.inc.php

Modified: branches/1.6/phpgwapi/inc/class.translation.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/branches/1.6/phpgwapi/inc/class.translation.inc.php?rev=28155&r1=28154&r2=28155&view=diff

— branches/1.6/phpgwapi/inc/class.translation.inc.php (original)
+++ branches/1.6/phpgwapi/inc/class.translation.inc.php Mon Oct 19 09:45:27 2009
@@ -61,9 +61,6 @@
*/
function translation($warnings = False)
{

  •   for ($i = 1; $i <= 9; $i++) {
    
  •   	$this->placeholders[] = '%'.$i;
    
  •   }
      $this->db = is_object($GLOBALS['egw']->db) ? $GLOBALS['egw']->db : $GLOBALS['egw_setup']->db;
    
      if (!isset($GLOBALS['egw_setup'])) {
    

@@ -190,7 +187,11 @@
{
if (count($vars) > 1)
{

  •   		$ret = str_replace($this->placeholders,$vars,$ret);
    
  •   		static $placeholders = array('%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
    
  •   		$ret = str_replace($placeholders,$vars,$ret);
      	}
      	else
      	{
    

Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference


eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs