Explorar el Código

Many more warnings removed.

Tyler Akins hace 24 años
padre
commit
89a34efd43

+ 3 - 3
src/folders_create.php

@@ -13,10 +13,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($imap_php))
@@ -37,7 +37,7 @@
       exit;
    }
 
-   if ($contain_subs == true)
+   if (isset($contain_subs) && $contain_subs == true)
       $folder_name = "$folder_name$dm";
 
    if ($folder_prefix && (substr($folder_prefix, -1) != $dm)) {

+ 2 - 2
src/folders_delete.php

@@ -18,10 +18,10 @@
    *     $mailbox - selected mailbox from the form
    */
    
-   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($imap_php))

+ 3 - 3
src/folders_rename_do.php

@@ -13,10 +13,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($imap_php))
@@ -52,7 +52,7 @@
 
    // Renaming a folder doesn't renames the folder but leaves you unsubscribed
    //    at least on Cyrus IMAP servers.
-   if ($isfolder) {
+   if (isset($isfolder)) {
       $newone = $newone.$dm;
       $orig = $orig.$dm;
    }   

+ 3 - 3
src/folders_rename_getname.php

@@ -13,10 +13,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($imap_php))
@@ -51,7 +51,7 @@
    echo "<FORM ACTION=\"folders_rename_do.php\" METHOD=\"POST\">\n";
    echo _("New name:");
    echo "<br><B>$old_parent . </B><INPUT TYPE=TEXT SIZE=25 NAME=new_name VALUE=\"$old_name\"><BR>\n";
-   if ($isfolder)
+   if (isset($isfolder))
       echo "<INPUT TYPE=HIDDEN NAME=isfolder VALUE=\"true\">";
    printf("<INPUT TYPE=HIDDEN NAME=orig VALUE=\"%s\">\n", $old);
    printf("<INPUT TYPE=HIDDEN NAME=old_name VALUE=\"%s\">\n", $old_name);

+ 2 - 2
src/folders_subscribe.php

@@ -13,10 +13,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($imap_php))

+ 10 - 5
src/help.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))
@@ -57,17 +57,19 @@
                   $ary[0] = trim($doc[$n]);
                }
                if (trim(strtolower($doc[$n])) == "<description>") {
+	          $ary[1] = "";
                   for ($n++;$n < count($doc) && (trim(strtolower($doc[$n])) != "</description>"); $n++) {
                      $ary[1] .= $doc[$n];
                   }
                }
                if (trim(strtolower($doc[$n])) == "<summary>") {
+	          $ary[2] = "";
                   for ($n++;$n < count($doc) && (trim(strtolower($doc[$n])) != "</summary>"); $n++) {
                      $ary[2] .= $doc[$n];
                   }
                }
             }   
-            if ($ary) {
+            if (isset($ary)) {
                $ary[3] = $n;
                return $ary;
             } else {
@@ -137,6 +139,8 @@
    }
    
    if ($help_exists) {
+      if (! isset($context))
+          $context = '';
       if ($context == "compose")
          $chapter = 4;
       else if ($context == "address")
@@ -152,7 +156,7 @@
       else if ($context == "search")
          $chapter = 8;
 
-      if (!$chapter) {
+      if (!isset($chapter)) {
          echo "<table cellpadding=0 cellspacing=0 border=0 align=center><tr><td>\n";
          echo "<b><center>" . _("Table of Contents") . "</center></b><br>";
          do_hook("help_chapter");
@@ -179,11 +183,12 @@
          echo "</center></small><br>\n";
 
          echo "<font size=5><b>$chapter - $help_info[0]</b></font><br><br>\n";
-         if ($help_info[1])
+         if (isset($help_info[1]))
             echo "$help_info[1]\n";
          else   
             echo "<p>$help_info[2]</p>\n";
 
+         $section = 0;
          for ($n = $help_info[3]; $n < count($doc); $n++) {
             $section++;
             $help_info = get_info($doc, $n);

+ 2 - 2
src/options_display.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 - 13
src/options_highlight.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))
@@ -29,6 +29,10 @@
    if (!isset($plugin_php))
       include("../functions/plugin.php");
 
+   if (! isset($action))
+       $action = '';
+   if (! isset($message_highlight_list))
+       $message_highlight_list = array();
 
    if ($action == "delete" && isset($theid)) {
       removePref($data_dir, $username, "highlight$theid");
@@ -89,6 +93,7 @@
    }
    if ($action == "edit" || $action == "add") {
       if (!isset($theid)) $theid = count($message_highlight_list);
+          $message_highlight_list[$theid] = array();
  
       $color_list[0] = "4444aa";
       $color_list[1] = "44aa44";
@@ -104,16 +109,22 @@
       $color_list[11] = "bfbfbf";
       $color_list[12] = "dfdfdf";
       $color_list[13] = "ffffff";               
-      for ($i=0; $i < 14; $i++) {
-         if ($color_list[$i] == $message_highlight_list[$theid]["color"]) {
-            $selected_choose = " checked";
-            ${"selected".$i} = " selected";
-            continue;
-         }
+      
+      $selected_input = "";
+      
+      if (isset($message_highlight_list[$theid]["color"]))
+      {
+          for ($i=0; $i < 14; $i++) {
+             if ($color_list[$i] == $message_highlight_list[$theid]["color"]) {
+                $selected_choose = " checked";
+                ${"selected".$i} = " selected";
+                continue;
+             }
+	 }
       }
-      if (!$message_highlight_list[$theid]["color"])
+      if (!isset($message_highlight_list[$theid]["color"]))
          $selected_choose = " checked";
-      else if (!$selected_choose)
+      else if (!isset($selected_choose))
          $selected_input = " checked";
  
       echo "<form name=f action=\"options_highlight.php\">\n";
@@ -125,7 +136,10 @@
       echo _("Identifying name") . ":";
       echo "      </b></td>\n";
       echo "      <td width=75%>\n";
-      $disp = $message_highlight_list[$theid]["name"];
+      if (isset($message_highlight_list[$theid]["name"]))
+          $disp = $message_highlight_list[$theid]["name"];
+      else
+          $disp = "";
       $disp = str_replace("\\\\", "\\", $disp);
       $disp = str_replace("\\\"", "\"", $disp);
       $disp = str_replace("\"", "&quot;", $disp);
@@ -154,7 +168,7 @@
       echo "            <option value=\"$color_list[12]\"$selected12>" . _("Light Gray") . "\n";
       echo "            <option value=\"$color_list[13]\"$selected13>" . _("White") . "\n";
       echo "         </select><br>\n";
-      echo "         <input type=\"radio\" name=color_type value=2$selected_input> &nbsp;". _("Other:") ."<input type=\"text\" value=\"";                                 
+      echo "         <input type=\"radio\" name=color_type value=2$selected_input> &nbsp;". _("Other:") ."<input type=\"text\" value=\"";
       if ($selected_input) echo $message_highlight_list[$theid]["color"];
       echo "\" name=\"newcolor_input\" size=7> "._("Ex: 63aa7f")."<br>\n";
       echo "      </td>\n";
@@ -177,7 +191,10 @@
       if ($message_highlight_list[$theid]["match_type"] == "subject") echo "            <option value=\"subject\" selected>Subject\n";
       else                                                         echo "            <option value=\"subject\">Subject\n";
       echo "         </select>\n";
-      $disp = $message_highlight_list[$theid]["value"];
+      if (isset($message_highlight_list[$theid]["value"]))
+          $disp = $message_highlight_list[$theid]["value"];
+      else
+          $disp = '';
       $disp = str_replace("\\\\", "\\", $disp);
       $disp = str_replace("\\\"", "\"", $disp);
       $disp = str_replace("\"", "&quot;", $disp);