From 49c1780697e72cbe0de9524d3533f53115962fbb Mon Sep 17 00:00:00 2001 From: philippe_mingo Date: Mon, 25 Feb 2002 18:54:20 +0000 Subject: [PATCH] "Marc Groot Koerkamp" patch for greek enconding. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2515 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/i18n.php | 17 ++++------------- functions/imap_messages.php | 10 +++++----- functions/imap_search.php | 4 ++-- functions/mailbox_display.php | 28 ++++++++++++++-------------- 4 files changed, 25 insertions(+), 34 deletions(-) diff --git a/functions/i18n.php b/functions/i18n.php index 01f90a2c..d533588c 100644 --- a/functions/i18n.php +++ b/functions/i18n.php @@ -435,11 +435,8 @@ function charset_decode_iso_8859_7 ($string) { * ISO-8859-7 characters from 11/04 (0xB4) to 11/06 (0xB6) * These are Unicode 900-902 */ - while (ereg("([\264-\266])", $string, $res)) { - $replace = '&#' . (ord($res[1])+720) . ';'; - $string = str_replace($res[1], $replace, $string); - } - + $string = preg_replace("/([\264-\266])/","'&#' . (ord(\\1)+720)",$string); + /* 11/07 (0xB7) Middle dot is the same in iso-8859-1 */ $string = str_replace("\267", '·', $string); @@ -447,10 +444,7 @@ function charset_decode_iso_8859_7 ($string) { * ISO-8859-7 characters from 11/08 (0xB8) to 11/10 (0xBA) * These are Unicode 900-902 */ - while (ereg("([\270-\272])", $string, $res)) { - $replace = '&#' . (ord($res[1])+720) . ";"; - $string = str_replace($res[1], $replace, $string); - } + $string = preg_replace("/([\270-\272])/","'&#' . (ord(\\1)+720)",$string); /* * 11/11 (0xBB) Right angle quotation mark is the same as in @@ -459,10 +453,7 @@ function charset_decode_iso_8859_7 ($string) { $string = str_replace("\273", '»', $string); /* And now the rest of the charset */ - while (ereg("([\274-\376])", $string, $res)) { - $replace = '&#' . (ord($res[1])+720) . ';'; - $string = str_replace($res[1], $replace, $string); - } + $string = preg_replace("/([\274-\376])/","'&#' . (ord(\\1)+720)",$string); return $string; } diff --git a/functions/imap_messages.php b/functions/imap_messages.php index f03e46aa..551f3ff9 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -264,11 +264,11 @@ function sqimap_get_flags_list ($imap_stream, $msg_list) { $result_flags[$id2index[$regs[1]]] = explode(" ", trim(ereg_replace('[\\(\\)\\\\]', '', $regs[2]))); } else { set_up_language($squirrelmail_language); - echo "
\n"; - echo _("ERROR : Could not complete request."); - echo "
\n"; - echo _("Unknown response from IMAP server: "); - echo $result_list[$i][0] . "

\n"; + echo "
\n" . + _("ERROR : Could not complete request.") . + "
\n" . + _("Unknown response from IMAP server: ") . + $result_list[$i][0] . "

\n"; exit; } } diff --git a/functions/imap_search.php b/functions/imap_search.php index da7e7838..4a1151c9 100644 --- a/functions/imap_search.php +++ b/functions/imap_search.php @@ -19,8 +19,8 @@ require_once('../functions/mime.php'); function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color, $search_position = '', $search_all, $count_all) { - global $msgs, $message_highlight_list, $squirrelmail_language, $languages, $index_order; - global $pos; + global $msgs, $message_highlight_list, $squirrelmail_language, $languages, $index_order, + $pos; $pos = $search_position; diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 76f48180..4231897a 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -194,13 +194,12 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $start * This function loops through a group of messages in the mailbox * and shows them to the user. */ -function showMessagesForMailbox -($imapConnection, $mailbox, $num_msgs, $start_msg, $sort, - $color, $show_num, $use_cache) { - global $msgs, $msort; - global $sent_folder, $draft_folder; - global $message_highlight_list; - global $auto_expunge; +function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, $start_msg, $sort, + $color, $show_num, $use_cache) { + global $msgs, $msort, + $sent_folder, $draft_folder, + $message_highlight_list, + $auto_expunge; /* If autoexpunge is turned on, then do it now. */ if ($auto_expunge == true) { @@ -347,21 +346,22 @@ function showMessagesForMailbox ** 2 = Name (up) ** 3 = Name (dn) **/ - session_unregister("msgs"); - if (($sort == 0) || ($sort == 1)) + session_unregister('msgs'); + if (($sort == 0) || ($sort == 1)) { $msort = array_cleave ($msgs, 'TIME_STAMP'); - elseif (($sort == 2) || ($sort == 3)) + } elseif (($sort == 2) || ($sort == 3)) { $msort = array_cleave ($msgs, 'FROM-SORT'); - elseif (($sort == 4) || ($sort == 5)) + } elseif (($sort == 4) || ($sort == 5)) { $msort = array_cleave ($msgs, 'SUBJECT-SORT'); - else // ($sort == 6) + } else // ($sort == 6) { $msort = $msgs; + } if ($sort < 6) { if ($sort % 2) { - asort($msort); + asort($msort); } else { - arsort($msort); + arsort($msort); } } session_register('msort'); -- 2.25.1