Fixes for minor bugs pointed out by Tyler Akins.
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 7 Nov 2002 11:55:09 +0000 (11:55 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 7 Nov 2002 11:55:09 +0000 (11:55 +0000)
These were found because Tyler has error_reporting set to E_ALL.
To all developers: *please TURN E_ALL ON* to prevent these!

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4124 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/file_prefs.php
functions/mailbox_display.php
include/load_prefs.php
plugins/abook_take/setup.php
themes/darkness.php

index c707d52..eadf3fa 100644 (file)
@@ -49,7 +49,9 @@ function cachePrefValues($data_dir, $username) {
     /* Read in the preferences. */
     $highlight_num = 0;
     while (! feof($file)) {
-        $pref = trim(fgets($file, 1024));
+        // Make sure that this fgets is larger than any of the pref strings
+        // could ever be.  1024 is too short
+        $pref = trim(fgets($file, 65536));
         $equalsAt = strpos($pref, '=');
         if ($equalsAt > 0) {
             $key = substr($pref, 0, $equalsAt);
index 0a4fc83..d0706aa 100644 (file)
@@ -118,7 +118,7 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox,
     * AAAAH! Make my eyes stop bleeding!
     * Who wrote this?!
     */
-    if (sizeof($message_highlight_list)){
+    if (is_array($message_highlight_list) && count($message_highlight_list)){
         foreach ($message_highlight_list as $message_highlight_list_part) {
             if (trim($message_highlight_list_part['value']) != '') {
                 $high_val   = strtolower($message_highlight_list_part['value']);
index 410ec47..f300101 100644 (file)
@@ -174,7 +174,7 @@ if( $ser = getPref($data_dir, $username, 'hililist') ) {
         $message_highlight_list[$i]['color'] = $highlight_array[1];
         $message_highlight_list[$i]['value'] = $highlight_array[2];
         $message_highlight_list[$i]['match_type'] = $highlight_array[3];
-        removePref($data_dir, $user_name, "highlight$i");
+        removePref($data_dir, $username, "highlight$i");
     }
     /* store in new format for the next time */
     setPref($data_dir, $username, 'hililist', serialize($message_highlight_list));
index 1130d92..ed9e6e4 100755 (executable)
@@ -61,7 +61,7 @@ function abook_take_read_array($array)
   $i = 0;
   while ($i < count($array))
   {
-    abook_take_read_string($array[$i]);
+    abook_take_read_string($array[$i]->getAddress());
     $i ++;
   }
 }
@@ -83,10 +83,14 @@ function abook_take_read()
                   html_tag( 'tr' ) .
                       html_tag( 'td' );
 
-              abook_take_read_string($message->header->from);
-              abook_take_read_array($message->header->cc);
-              abook_take_read_array($message->header->reply_to);
-              abook_take_read_array($message->header->to);
+              if (isset($message->rfc822_header->from))
+                  abook_take_read_array($message->rfc822_header->from);
+              if (isset($message->rfc822_header->cc))
+                  abook_take_read_array($message->rfc822_header->cc);
+              if (isset($message->rfc822_header->reply_to))
+                  abook_take_read_array($message->rfc822_header->reply_to);
+              if (isset($message->rfc822_header->to))
+                  abook_take_read_array($message->rfc822_header->to);
 
 
               $new_body = $body;
index 3dd97c4..4ac0ff2 100755 (executable)
@@ -38,8 +38,8 @@ function Darkness_HeaderPlugin() {
    global $PHP_SELF, $Darkness_Transition;
    
    if (substr($PHP_SELF, -18) == '/src/left_main.php') {
-      echo '<meta http-equiv='Page-Enter' content='' .
-         'blendTrans(Duration=2.0)'>' . '\n';
+      echo '<meta http-equiv="Page-Enter" content="' .
+         'blendTrans(Duration=2.0)">' . '\n';
    }
         
 ?><script language=javascript>