From 673f935035f4872437d24a4ce4fabb305dad9696 Mon Sep 17 00:00:00 2001 From: kink Date: Thu, 7 Nov 2002 11:55:09 +0000 Subject: [PATCH] Fixes for minor bugs pointed out by Tyler Akins. 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 | 4 +++- functions/mailbox_display.php | 2 +- include/load_prefs.php | 2 +- plugins/abook_take/setup.php | 14 +++++++++----- themes/darkness.php | 4 ++-- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/functions/file_prefs.php b/functions/file_prefs.php index c707d52f..eadf3fad 100644 --- a/functions/file_prefs.php +++ b/functions/file_prefs.php @@ -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); diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 0a4fc83e..d0706aae 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -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']); diff --git a/include/load_prefs.php b/include/load_prefs.php index 410ec472..f300101c 100644 --- a/include/load_prefs.php +++ b/include/load_prefs.php @@ -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)); diff --git a/plugins/abook_take/setup.php b/plugins/abook_take/setup.php index 1130d924..ed9e6e4d 100755 --- a/plugins/abook_take/setup.php +++ b/plugins/abook_take/setup.php @@ -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; diff --git a/themes/darkness.php b/themes/darkness.php index 3dd97c48..4ac0ff29 100755 --- a/themes/darkness.php +++ b/themes/darkness.php @@ -38,8 +38,8 @@ function Darkness_HeaderPlugin() { global $PHP_SELF, $Darkness_Transition; if (substr($PHP_SELF, -18) == '/src/left_main.php') { - echo '' . '\n'; + echo '' . '\n'; } ?>