Permalink
Browse files

Change while with foreach loops

  • Loading branch information...
1 parent d2063dc commit 1a929e73cabc17681dc6cf57e433e22b661d10a8 @acidvertigo acidvertigo committed Aug 17, 2011
Showing with 4 additions and 7 deletions.
  1. +4 −7 catalog/includes/classes/email.php
@@ -68,8 +68,7 @@ function email($headers = '') {
$this->headers[] = 'MIME-Version: 1.0';
- reset($headers);
- while (list(,$value) = each($headers)) {
+ foreach($headers as $value) {
if (tep_not_null($value)) {
$this->headers[] = $value;
}
@@ -322,15 +321,13 @@ function build_message($params = '') {
if ($params == '') $params = array();
if (count($params) > 0) {
- reset($params);
- while(list($key, $value) = each($params)) {
+ foreach ($params as $key => $value) {
$this->build_params[$key] = $value;
}
}
if (tep_not_null($this->html_images)) {
- reset($this->html_images);
- while (list(,$value) = each($this->html_images)) {
+ foreach($this->html_images as $value) {
$this->html = str_replace($value['name'], 'cid:' . $value['cid'], $this->html);
}
}
@@ -454,7 +451,7 @@ function build_message($params = '') {
$this->output = $output['body'];
reset($output['headers']);
- while (list($key, $value) = each($output['headers'])) {
+ foreach ($output['headers'] as $key => $value) {
$headers[] = $key . ': ' . $value;
}

0 comments on commit 1a929e7

Please sign in to comment.