- fix for mbstring.overload=7

- potential multibyte/charset problem: addslashes was done before translate !!!
This commit is contained in:
Ralf Becker 2004-05-08 22:30:19 +00:00
parent a806ba7ec3
commit 731a50b29f

View File

@ -405,11 +405,10 @@
$lines = file($appfile); $lines = file($appfile);
foreach($lines as $line) foreach($lines as $line)
{ {
list($message_id,$app_name,,$content) = explode("\t",$line); // we realy need to split with tab+cr, as only this works with mbstring.overload=7 !!!
$message_id = $this->db->db_addslashes(substr(strtolower(chop($message_id)),0,MAX_MESSAGE_ID_LENGTH)); list($message_id,$app_name,,$content) = split("[\t\n]",$line);
$app_name = $this->db->db_addslashes(chop($app_name)); $message_id = substr(strtolower(chop($message_id)),0,MAX_MESSAGE_ID_LENGTH);
$content = $this->db->db_addslashes(chop($content)); $app_name = chop($app_name);
$raw[$app_name][$message_id] = $content; $raw[$app_name][$message_id] = $content;
} }
$GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang][$app] = filectime($appfile); $GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang][$app] = filectime($appfile);
@ -420,12 +419,17 @@
//echo "<p>raw($lang)=<pre>".print_r($raw,True)."</pre>\n"; //echo "<p>raw($lang)=<pre>".print_r($raw,True)."</pre>\n";
foreach($raw as $app_name => $ids) foreach($raw as $app_name => $ids)
{ {
$app_name = $this->db->db_addslashes($app_name);
foreach($ids as $message_id => $content) foreach($ids as $message_id => $content)
{ {
if ($this->system_charset) if ($this->system_charset)
{ {
$content = $this->convert($content,$charset,$this->system_charset); $content = $this->convert($content,$charset,$this->system_charset);
} }
$message_id = $this->db->db_addslashes($message_id);
$content = $this->db->db_addslashes($content);
$addit = False; $addit = False;
//echo '<br>APPNAME:' . $app_name . ' PHRASE:' . $message_id; //echo '<br>APPNAME:' . $app_name . ' PHRASE:' . $message_id;
if ($upgrademethod == 'addmissing') if ($upgrademethod == 'addmissing')