Replacement of deprecated each() calls.
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 18 Jan 2019 13:53:30 +0000 (08:53 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 18 Jan 2019 13:53:30 +0000 (08:53 -0500)
Found some occurrences of each() function calls. Replacing them with
proper foreach calls.

controllers/admin.php
controllers/front.php
models/admin/management/index.php

index 8411a50..17e59ab 100755 (executable)
@@ -1027,7 +1027,7 @@ class glmMembersAdmin extends GlmPluginSupport
 
         // Check for modified settings to save in conf
         if (isset($results['settings'])) {
-            while (list($key, $val) = each($results['settings'])) {
+            foreach ( $results['settings'] as $key => $val ) {
                 $this->config['settings'][$key] = $val;
             }
         }
index 0fe89d9..5d6aa9c 100644 (file)
@@ -51,7 +51,7 @@ class glmMembersFront extends GlmPluginSupport
         $this->config = $config;
 
         // Add any shortcodes from the config 'shortcodes' table
-        while (list($key, $val) = each($this->config['shortcodes'])) {
+        foreach ( $this->config['shortcodes'] as $key => $val ) {
             add_shortcode($key,
                 array(
                     $this,
@@ -344,7 +344,7 @@ class glmMembersFront extends GlmPluginSupport
             // Check shortcode for cache configuration
             $scCacheControl = false;
             foreach ($this->config['addOns'] as $addon) {
-                while (list($key, $val) = each($addon['shortcodes'])) {
+                foreach ( $addon['shortcodes'] as $key => $val ) {
                     if ($key == $shortcode && isset($val['cacheControl'])) {
                         $scCacheControl = $val['cacheControl'];
                     }
@@ -424,7 +424,7 @@ class glmMembersFront extends GlmPluginSupport
                 $defaults = $this->wpdb->get_row("SELECT * FROM ".$shortcodeData['table']." WHERE id = 1;", ARRAY_A);
                 if ($defaults) {
 
-                    while (list($key, $val) = each($shortcodeData['attributes'])) {
+                    foreach ( $shortcodeData['attributes'] as $key => $val ) {
                         if (isset($defaults[$key]) && $val != false) {
                             $shortcodeData['attributes'][$key] = $defaults[$val];
                         }
@@ -639,7 +639,7 @@ class glmMembersFront extends GlmPluginSupport
             $view = $results['view'];
             // Check for modified settings to save in conf
             if (isset($results['settings'])) {
-                while (list($key, $val) = each($results['settings'])) {
+                foreach ( $results['settings'] as $key => $val ) {
                     $this->config['settings'][$key] = $val;
                 }
             }
index bd0b277..45b50d0 100755 (executable)
@@ -246,4 +246,4 @@ class GlmMembersAdmin_management_index extends GlmDataSettingsGeneral
     }
 }
 
-?>
\ No newline at end of file
+?>