Happy New Year
[squirrelmail.git] / functions / imap_mailbox.php
index 9b2f2b84a54d6ce7da38cbb7cad3fc5d195edf5e..d288f1a00d46d3ba8417fd4ba322f914709c0b95 100755 (executable)
@@ -5,7 +5,7 @@
  *
  * This implements all functions that manipulate mailboxes
  *
- * @copyright 1999-2020 The SquirrelMail Project Team
+ * @copyright 1999-2021 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -857,10 +857,10 @@ function sqimap_mailbox_option_list($imap_stream, $show_selected = 0, $folder_sk
         $lowerbox = strtolower(sm_encode_html_special_chars($value));
         $sel = false;
         if ($show_selected != 0) {
-            reset($show_selected);
-            while (!$sel && (list($x, $val) = each($show_selected))) {
+            foreach ($show_selected as $val) {
                 if (strtolower($value) == strtolower(sm_encode_html_special_chars($val))) {
                     $sel = true;
+                    break;
                 }
             }
         }