Remove use of each() as it is deprecated
[squirrelmail.git] / include / load_prefs.php
index 633531349697b5b4663bcc2dc06295da8bdf0077..7db84c642c84a492fa2337b255475225b8ca85b3 100644 (file)
@@ -511,16 +511,20 @@ $oTemplate = Template::construct_template($sTemplateID);
 // need to adjust $chosen_theme path with SM_PATH 
 $chosen_theme_path = preg_replace("/(\.\.\/){1,}/", SM_PATH, $chosen_theme_path);
 $found_theme = false;
-while (!$found_theme && (list($index, $data) = each($user_themes))) {
-    if ($data['PATH'] == $chosen_theme_path)
+foreach ($user_themes as $data) {
+    if ($data['PATH'] == $chosen_theme_path) {
         $found_theme = true;
+        break;
+    }
 }
 
 if (!$found_theme) {
     $template_themes = $oTemplate->get_alternative_stylesheets(true);
-    while (!$found_theme && (list($path, $name) = each($template_themes))) {
-        if ($path == $chosen_theme_path)
+    foreach ($template_themes as $path => $name) {
+        if ($path == $chosen_theme_path) {
             $found_theme = true;
+            break;
+        }
     }
 }