Skip to content
Browse files

Change while loops with foreach

  • Loading branch information...
1 parent 7820879 commit ba1176073d163b71cb9266d017bf50c71e6d7347 @acidvertigo acidvertigo committed May 25, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 catalog/includes/functions/general.php
View
9 catalog/includes/functions/general.php
@@ -171,7 +171,8 @@ function tep_get_all_get_params($exclude_array = '') {
$get_url = '';
if (is_array($HTTP_GET_VARS) && (sizeof($HTTP_GET_VARS) > 0)) {
reset($HTTP_GET_VARS);
- while (list($key, $value) = each($HTTP_GET_VARS)) {
+
+ foreach($HTTP_GET_VARS as $key => $value) {
if ( is_string($value) && (strlen($value) > 0) && ($key != tep_session_name()) && ($key != 'error') && (!in_array($key, $exclude_array)) && ($key != 'x') && ($key != 'y') ) {
$get_url .= $key . '=' . rawurlencode(stripslashes($value)) . '&';
}
@@ -947,7 +948,8 @@ function tep_get_uprid($prid, $params) {
$attributes_ids = '';
reset($params);
- while (list($option, $value) = each($params)) {
+
+ foreach($params as $key => $option) {
if (is_numeric($option) && is_numeric($value)) {
$attributes_ids .= '{' . (int)$option . '}' . (int)$value;
} else {
@@ -1129,7 +1131,8 @@ function tep_array_to_string($array, $exclude = '', $equals = '=', $separator =
$get_string = '';
if (sizeof($array) > 0) {
- while (list($key, $value) = each($array)) {
+
+foreach($array as $key => $value) {
if ( (!in_array($key, $exclude)) && ($key != 'x') && ($key != 'y') ) {
$get_string .= $key . $equals . $value . $separator;
}

0 comments on commit ba11760

Please sign in to comment.
Something went wrong with that request. Please try again.