From: lkehresman Date: Wed, 31 Jan 2001 03:00:08 +0000 (+0000) Subject: fixed more warnings X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=6142318960928725ed3e2fe88ced7b5eb5397b0a fixed more warnings git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@993 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/ChangeLog b/ChangeLog index 1b8a6755..6ce12351 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ Version 1.0.1 -- DEVELOPMENT ---------------------------- +- Removed unnecessary echo statements by breaking out of PHP +- Changed evaluation method from using " to ' for speed improvements - If no plugin array set in config.php, now handled correctly - If subject is > 55 chars, trims it and puts "..." in message list - Hundreds of minor changes to remove all verbose PHP warning messages diff --git a/functions/imap_search.php b/functions/imap_search.php index 7d497ab4..de6bf6d8 100644 --- a/functions/imap_search.php +++ b/functions/imap_search.php @@ -22,7 +22,7 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo # Construct the Search QuERY - if ($languages[$squirrelmail_language]["CHARSET"]) { + if (isset($languages[$squirrelmail_language]["CHARSET"]) && $languages[$squirrelmail_language]["CHARSET"]) { $ss = "a001 SEARCH CHARSET ".$languages[$squirrelmail_language]["CHARSET"]." ALL $search_where \"$search_what\"\r\n"; } else { $ss = "a001 SEARCH ALL $search_where \"$search_what\"\r\n"; @@ -45,10 +45,10 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo } #If nothing is found * SEARCH should be the first error else echo errors - if (strstr($errors,"* SEARCH")) { + if (isset($errors) && strstr($errors,"* SEARCH")) { echo "
No Messages Found
"; return; - } else { + } else if (isset($errors)) { echo ""; } @@ -117,7 +117,7 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo $i = 0; $j = 0; while ($j < count($messagelist)) { - if ($messages[$j]["FLAG_DELETED"] == true) { + if (isset($messages[$j]["FLAG_DELETED"]) && $messages[$j]["FLAG_DELETED"] == true) { $j++; continue; } @@ -132,6 +132,7 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo if (count($messagelist) > 0) { $j=0; + if (!isset ($msg)) { $msg = ""; } mail_message_listing_beginning($imapConnection, "move_messages.php?msg=$msg&mailbox=$urlMailbox&where=".urlencode($search_where)."&what=".urlencode($search_what), '', -1, '' . _("Found") . ' ' . count($messagelist) . ' ' . _("messages") . '', diff --git a/functions/mime.php b/functions/mime.php index e1dd774d..ffb9c59a 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -27,7 +27,7 @@ var $type0 = '', $type1 = '', $boundary = '', $charset = ''; var $encoding = '', $size = 0, $to = '', $from = '', $date = ''; var $cc = '', $bcc = '', $reply_to = '', $subject = ''; - var $id = 0, $mailbox = '', $description = ''; + var $id = 0, $mailbox = '', $description = '', $filename = ''; var $entity_id = 0, $message_id = 0; } @@ -37,11 +37,11 @@ more objects of type message. See documentation in mime.txt for a better description of how this works. **/ - var $header; - var $entities; + var $header = ''; + var $entities = ''; function addEntity ($msg) { - $this->entities[count($this->entities)] = $msg; + $this->entities[] = $msg; } } @@ -537,6 +537,7 @@ global $startMessage, $color; static $ShownHTML; + $body = ""; if ($ShownHTML == 0) { $ShownHTML = 1; diff --git a/src/download.php b/src/download.php index d24b9048..04d760e3 100644 --- a/src/download.php +++ b/src/download.php @@ -11,10 +11,10 @@ ** $Id$ **/ - if (!isset($config_php)) - include("../config/config.php"); if (!isset($strings_php)) include("../functions/strings.php"); + if (!isset($config_php)) + include("../config/config.php"); if (!isset($imap_php)) include("../functions/imap.php"); if (!isset($mime_php)) @@ -110,7 +110,7 @@ header("Pragma: "); header("Content-Description: SquirrelMail Attachment"); - if ($absolute_dl == "true") { + if (isset($absolute_dl) && $absolute_dl == "true") { switch($type0) { case "text": $body = mime_fetch_body($imapConnection, $passed_id, $passed_ent_id); diff --git a/src/options_folder.php b/src/options_folder.php index 10da1f0e..21605d1d 100644 --- a/src/options_folder.php +++ b/src/options_folder.php @@ -12,10 +12,10 @@ session_start(); - if (!isset($config_php)) - include("../config/config.php"); if (!isset($strings_php)) include("../functions/strings.php"); + if (!isset($config_php)) + include("../config/config.php"); if (!isset($page_header_php)) include("../functions/page_header.php"); if (!isset($display_messages_php)) @@ -33,7 +33,7 @@ displayPageHeader($color, "None"); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); - $boxes = sqimap_mailbox_list($imapConnection, $boxes); + $boxes = sqimap_mailbox_list($imapConnection, $boxes=""); sqimap_logout($imapConnection); ?>
diff --git a/src/options_order.php b/src/options_order.php index f253b456..66aedee8 100644 --- a/src/options_order.php +++ b/src/options_order.php @@ -12,10 +12,10 @@ session_start(); - if (!isset($config_php)) - include("../config/config.php"); if (!isset($strings_php)) include("../functions/strings.php"); + if (!isset($config_php)) + include("../config/config.php"); if (!isset($page_header_php)) include("../functions/page_header.php"); if (!isset($display_messages_php)) @@ -30,6 +30,7 @@ include("../functions/plugin.php"); + if (! isset($action)) { $action = ""; } if ($action == "delete" && isset($theid)) { removePref($data_dir, $username, "highlight$theid"); } else if ($action == "save") { @@ -52,6 +53,8 @@ $available[5] = _("Flags"); $available[6] = _("Size"); + if (! isset($method)) { $method = ""; } + if ($method == "up" && $num > 1) { $prev = $num-1; $tmp = $index_order[$prev]; diff --git a/src/search.php b/src/search.php index 3bdcbdbe..7eb98a18 100644 --- a/src/search.php +++ b/src/search.php @@ -57,7 +57,7 @@ $boxes = sqimap_mailbox_list($imapConnection); for ($i = 0; $i < count($boxes); $i++) { - if ($boxes[$i]["flags"][0] != "noselect" && $boxes[$i]["flags"][1] != "noselect" && $boxes[$i]["flags"][2] != "noselect") { + if (!in_array("noselect", $boxes[$i]["flags"])) { $box = $boxes[$i]["unformatted"]; $box2 = replace_spaces($boxes[$i]["formatted"]); if ($mailbox == $box) @@ -80,22 +80,22 @@ echo " \n"; echo " \n";