fix for mbstring.overload=7, hopefully that works now in all cases

This commit is contained in:
Ralf Becker 2004-05-09 10:17:44 +00:00
parent 25a30c53c6
commit 291da54d43
2 changed files with 6 additions and 6 deletions

View File

@ -60,10 +60,9 @@
$fp = fopen($fn,'r');
while ($data = fgets($fp,8000))
{
// this is not working if mbstring.overloading = 7 and the content contains a special char
// list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1));
list($message_id,$app_name,$null,$content) = split("[\t\n]",$data);
$this->langarray[strtolower(trim($message_id))] = $content;
// explode with "\t" and removing "\n" with str_replace, needed to work with mbstring.overload=7
list($message_id,,,$content) = explode("\n",$data);
$this->langarray[strtolower(trim($message_id))] = str_replace("\n",'',$content);
}
fclose($fp);
}

View File

@ -405,8 +405,9 @@
$lines = file($appfile);
foreach($lines as $line)
{
// we realy need to split with tab+cr, as only this works with mbstring.overload=7 !!!
list($message_id,$app_name,,$content) = split("[\t\n]",$line);
// 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("\n",'',$content);
$message_id = substr(strtolower(chop($message_id)),0,MAX_MESSAGE_ID_LENGTH);
$app_name = chop($app_name);
$raw[$app_name][$message_id] = $content;