Parcourir la source

* Fixed bug when editing message highlighting

Tyler Akins il y a 24 ans
Parent
commit
2b6ca6a9d5
1 fichiers modifiés avec 8 ajouts et 4 suppressions
  1. 8 4
      src/options_highlight.php

+ 8 - 4
src/options_highlight.php

@@ -92,8 +92,11 @@
       echo "<br>\n";
    }
    if ($action == 'edit' || $action == 'add') {
-      if (!isset($theid)) $theid = count($message_highlight_list);
-          $message_highlight_list[$theid] = array();
+      if (!isset($theid))
+      {
+        $theid = count($message_highlight_list);
+        $message_highlight_list[$theid] = array();
+      }
  
       $color_list[0] = '4444aa';
       $color_list[1] = '44aa44';
@@ -111,6 +114,7 @@
       $color_list[13] = 'ffffff';               
       
       $selected_input = '';
+      $selected_choose = '';
       
       for ($i=0; $i < 14; $i++) {
          ${"selected".$i} = '';
@@ -122,11 +126,11 @@
                ${"selected".$i} = ' selected';
                continue;
             }
-	     }
+	 }
       }
       if (!isset($message_highlight_list[$theid]['color']))
          $selected_choose = ' checked';
-      else if (!isset($selected_choose))
+      else if ($selected_choose == '')
          $selected_input = ' checked';
  
       echo '<form name="f" action="options_highlight.php">' . "\n";