fixed more warnings
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 31 Jan 2001 03:00:08 +0000 (03:00 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 31 Jan 2001 03:00:08 +0000 (03:00 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@993 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/imap_search.php
functions/mime.php
src/download.php
src/options_folder.php
src/options_order.php
src/search.php

index 1b8a6755265f293f7e1e93370ab99ee31cfb7f39..6ce1235165474372215cc13e6f2d4b54a709fbb7 100644 (file)
--- 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
index 7d497ab49360bd033f9f61a4c94e73242cf6dfe9..de6bf6d8e324dc70c3d8d80eeffcd3e8b42aa139 100644 (file)
@@ -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 "<br><CENTER>No Messages Found</CENTER>";
       return;
-   } else {
+   } else if (isset($errors)) {
       echo "<!-- ".$errors." -->";
    }
 
@@ -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, '<b>' . _("Found") . ' ' . count($messagelist) . ' ' . _("messages") . '</b>',
index e1dd774d6501f9d867285a4e777d7f73033027b3..ffb9c59a3f7a7543504678cb89ac5d3d956fbd7d 100644 (file)
@@ -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;
    }
    
           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;
       }
    }
 
       global $startMessage, $color;
       static $ShownHTML;
       
+         $body = "";
       if ($ShownHTML == 0)
       {
             $ShownHTML = 1;
index d24b9048d5474f4610d7e7178e5994d2679da114..04d760e30d9242301633178c0ceea37587e3e882 100644 (file)
     **  $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))
 
    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);
index 10da1f0e5357ceadc3113bcfec06a392f00be3ff..21605d1deee6d9f98a679fb23d55aed1f122c9c6 100644 (file)
 
    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);
 ?>
    <br>
index f253b456b4a6b9453e796d7a8c609e25cc6bfef8..66aedee83ac55e0c6d114a79b47c7f70e65770ad 100644 (file)
 
    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];
index 3bdcbdbe5dfb3a789977c230fe406f5ffd965715..7eb98a183faa78e51be51356758c4bff51f4fb4d 100644 (file)
@@ -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)
    echo "       <TD ALIGN=\"RIGHT\" WIDTH=33%>\n";
    echo "         <SELECT NAME=\"where\">";
    
-   if ($where == "BODY") echo "           <OPTION VALUE=\"BODY\" SELECTED>"._("Body")."\n";
+   if (isset($where) && $where == "BODY") echo "           <OPTION VALUE=\"BODY\" SELECTED>"._("Body")."\n";
    else echo "           <OPTION VALUE=\"BODY\">"._("Body")."\n";
    
-   if ($where == "TEXT") echo "           <OPTION VALUE=\"TEXT\" SELECTED>"._("Everywhere")."\n";
+   if (isset($where) && $where == "TEXT") echo "           <OPTION VALUE=\"TEXT\" SELECTED>"._("Everywhere")."\n";
    else echo "           <OPTION VALUE=\"TEXT\">"._("Everywhere")."\n";
    
-   if ($where == "SUBJECT") echo "           <OPTION VALUE=\"SUBJECT\" SELECTED>"._("Subject")."\n";
+   if (isset($where) && $where == "SUBJECT") echo "           <OPTION VALUE=\"SUBJECT\" SELECTED>"._("Subject")."\n";
    else echo "           <OPTION VALUE=\"SUBJECT\">"._("Subject")."\n";
    
-   if ($where == "FROM") echo "           <OPTION VALUE=\"FROM\" SELECTED>"._("From")."\n";
+   if (isset($where) && $where == "FROM") echo "           <OPTION VALUE=\"FROM\" SELECTED>"._("From")."\n";
    else echo "           <OPTION VALUE=\"FROM\">"._("From")."\n";
    
-   if ($where == "CC") echo "           <OPTION VALUE=\"Cc\" SELECTED>"._("Cc")."\n";
+   if (isset($where) && $where == "CC") echo "           <OPTION VALUE=\"Cc\" SELECTED>"._("Cc")."\n";
    else echo "           <OPTION VALUE=\"CC\">"._("Cc")."\n";
    
-   if ($where == "TO") echo "           <OPTION VALUE=\"TO\" SELECTED>"._("To")."\n";
+   if (isset($where) && $where == "TO") echo "           <OPTION VALUE=\"TO\" SELECTED>"._("To")."\n";
    else echo "           <OPTION VALUE=\"TO\">"._("To")."\n";
    
    echo "         </SELECT>\n";