diff --git a/phpgwapi/inc/class.error.inc.php b/phpgwapi/inc/class.error.inc.php index 4988cc5619..a3490ef357 100755 --- a/phpgwapi/inc/class.error.inc.php +++ b/phpgwapi/inc/class.error.inc.php @@ -48,7 +48,15 @@ $str = 'p_'.$counter; if(isset($parms[$str]) && !empty($parms[$str])) { - $parray[] = $parms[$str]; + $parray[$counter] = $parms[$str]; + } + else + { + $str = 'p'.$counter; + if(isset($parms[$str]) && !empty($parms[$str])) + { + $parray[$counter] = $parms[$str]; + } } } $fname = $parms['file']; @@ -63,6 +71,14 @@ { $this->msg = trim($etext); } + + @reset($parray); + while( list($key,$val) = each( $parray ) ) + { + $this->msg = preg_replace( "/%$key/", "'".$val."'", $this->msg ); + } + @reset($parray); + $this->timestamp = time(); $this->parms = $parray; $this->ismsg = $parms['ismsg']; diff --git a/phpgwapi/inc/class.errorlog.inc.php b/phpgwapi/inc/class.errorlog.inc.php index 135c05f90a..ab47fcfd88 100644 --- a/phpgwapi/inc/class.errorlog.inc.php +++ b/phpgwapi/inc/class.errorlog.inc.php @@ -134,7 +134,7 @@ ."', '". $err->severity . "'" .", '". $err->code . "'" .", '". $db->db_addslashes($err->msg) . "'" - .", '". $db->db_addslashes(implode('|',$err->parms)). "'" + .", '". $db->db_addslashes((count($err->parms) > 1?implode('|',$err->parms):$err->parms[1])). "'" .", '". $err->fname . "'" .", " . intval($err->line) .")"