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 c707d52f143988e8a269620aa772ddcebf4d509d..eadf3fad7ef75c08d474d10b09cae653742da0fc 100644 (file)
@@ -49,7 +49,9 @@ function cachePrefValues($data_dir, $username) {
     /* Read in the preferences. */
     $highlight_num = 0;
     while (! feof($file)) {
     /* 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);
         $equalsAt = strpos($pref, '=');
         if ($equalsAt > 0) {
             $key = substr($pref, 0, $equalsAt);
index 0a4fc83e4d1e4ab54c1ffcd77cc9208bb69d8550..d0706aae41d238e8660f7b011c2a17752e05f115 100644 (file)
@@ -118,7 +118,7 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox,
     * AAAAH! Make my eyes stop bleeding!
     * Who wrote this?!
     */
     * 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']);
         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 410ec472db83a92c8b958c51976e4c12021079f2..f300101c86bceea5e2cdad5a459b3650514f4632 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];
         $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));
     }
     /* store in new format for the next time */
     setPref($data_dir, $username, 'hililist', serialize($message_highlight_list));
index 1130d9241e39649c81bca9203783eb5a4fa043c0..ed9e6e4d791d01d4061b7c5317e966d7141137e4 100755 (executable)
@@ -61,7 +61,7 @@ function abook_take_read_array($array)
   $i = 0;
   while ($i < count($array))
   {
   $i = 0;
   while ($i < count($array))
   {
-    abook_take_read_string($array[$i]);
+    abook_take_read_string($array[$i]->getAddress());
     $i ++;
   }
 }
     $i ++;
   }
 }
@@ -83,10 +83,14 @@ function abook_take_read()
                   html_tag( 'tr' ) .
                       html_tag( 'td' );
 
                   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;
 
 
               $new_body = $body;
index 3dd97c489a36d14d672bb8603063a036d1e2198b..4ac0ff299f97929eeaf57116475373e005a6d610 100755 (executable)
@@ -38,8 +38,8 @@ function Darkness_HeaderPlugin() {
    global $PHP_SELF, $Darkness_Transition;
    
    if (substr($PHP_SELF, -18) == '/src/left_main.php') {
    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>
    }
         
 ?><script language=javascript>