"Marc Groot Koerkamp" <marc@its-projects.nl> patch for greek enconding.
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 25 Feb 2002 18:54:20 +0000 (18:54 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 25 Feb 2002 18:54:20 +0000 (18:54 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2515 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/i18n.php
functions/imap_messages.php
functions/imap_search.php
functions/mailbox_display.php

index 01f90a2cb9418c709fc654a91f71a9fcab7691fc..d533588c32ca233a8962bc57d2108b7db7bfdb7f 100644 (file)
@@ -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", '&#183;', $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", '&#187;', $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;
 }
index f03e46aa4a12f426ea455477bcc083f1c8de8615..551f3ff92d587ecc6d838e1c721369b84979cbe6 100755 (executable)
@@ -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 "<br><b><font color=$color[2]>\n";
-            echo _("ERROR : Could not complete request.");
-            echo "</b><br>\n";
-            echo _("Unknown response from IMAP server: ");
-            echo $result_list[$i][0] . "</font><br>\n";
+            echo "<br><b><font color=$color[2]>\n" .
+                 _("ERROR : Could not complete request.") .
+                 "</b><br>\n" .
+                 _("Unknown response from IMAP server: ") .
+                 $result_list[$i][0] . "</font><br>\n";
             exit;
         }
     }
index da7e783811303cb8e8ac75ae6a2c2ef13069ad20..4a1151c9a419b91b6fb59a3020063d46303dd3c7 100644 (file)
@@ -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;
 
index 76f48180abac906d07d9d805bda151b8ab0ad46b..4231897a0bfb2a2d7aeeedac91b5a45fd6d112d7 100644 (file)
@@ -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');