From bb29a8e4d058f5a1b960320125505096e4357794 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 1 Aug 2004 08:02:53 +0000 Subject: [PATCH] removed ereg_replace which causes problems with multibyte charsets and mbstring.function_overload=7 --- phpgwapi/inc/class.translation_sql.inc.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/phpgwapi/inc/class.translation_sql.inc.php b/phpgwapi/inc/class.translation_sql.inc.php index 85a8f22ffe..4e1d7ad5c8 100644 --- a/phpgwapi/inc/class.translation_sql.inc.php +++ b/phpgwapi/inc/class.translation_sql.inc.php @@ -413,20 +413,19 @@ $lines = file($appfile); foreach($lines as $line) { - $line = eregi_replace("\t+", "\t", $line); - $_f_buffer = split("\t", $line); + // explode with "\t" and removing "\n" with str_replace, needed to work with mbstring.overload=7 + list($message_id,$app_name,,$content) = $_f_buffer = explode("\t",$line); + $content=str_replace(array("\n","\r"),'',$content); - # Bad Line if( count($_f_buffer) != 4 ) { - $line_display = eregi_replace("\t", "\\t", $line); - $line_display = eregi_replace("\n", "\\n", $line_display); - $this->line_rejected[] = Array("appfile" => $appfile, "line" => $line_display); + $line_display = str_replace(array("\t","\n"), + array("\\t","\\n"), $line); + $this->line_rejected[] = array( + 'appfile' => $appfile, + 'line' => $line_display, + ); } - - // explode with "\t" and removing "\n" with str_replace, needed to work with mbstring.overload=7 - list($message_id,$app_name,,$content) = explode("\t",$line); - $content=str_replace(array("\n","\r"),'',$content); $message_id = substr(strtolower(chop($message_id)),0,MAX_MESSAGE_ID_LENGTH); $app_name = chop($app_name); $raw[$app_name][$message_id] = $content;