From 482441f378a7ee7e54ff86f73cdccf8ebcf9a9ba Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 18 May 2018 08:03:23 +1000 Subject: [PATCH] dev/core#117 Replace useage of deprecated function each with foreach in Mail/mime Mail/mimePart and Mail/mimeDecode --- Mail/mime.php | 6 +++--- Mail/mimeDecode.php | 6 +++--- Mail/mimePart.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Mail/mime.php b/Mail/mime.php index ca815231c..5c5b71183 100644 --- a/Mail/mime.php +++ b/Mail/mime.php @@ -183,7 +183,7 @@ function __construct($params = array()) // Update build parameters if (!empty($params) && is_array($params)) { - while (list($key, $value) = each($params)) { + foreach ($params as $key => $value) { $this->_build_params[$key] = $value; } } @@ -842,7 +842,7 @@ function saveMessageBody($filename, $params = null) function &get($params = null, $filename = null, $skip_head = false) { if (isset($params)) { - while (list($key, $value) = each($params)) { + foreach ($params as $key => $value) { $this->_build_params[$key] = $value; } } @@ -1283,7 +1283,7 @@ function encodeRecipients($recipients) function _encodeHeaders($input, $params = array()) { $build_params = $this->_build_params; - while (list($key, $value) = each($params)) { + foreach ($params as $key => $value) { $build_params[$key] = $value; } diff --git a/Mail/mimeDecode.php b/Mail/mimeDecode.php index 4cf1ad7a5..155edac41 100644 --- a/Mail/mimeDecode.php +++ b/Mail/mimeDecode.php @@ -260,7 +260,7 @@ function _decode($headers, $body, $default_ctype = 'text/plain') } reset($headers); - while (list($key, $value) = each($headers)) { + foreach($headers as $key => $value) { $headers[$key]['name'] = strtolower($headers[$key]['name']); switch ($headers[$key]['name']) { @@ -273,7 +273,7 @@ function _decode($headers, $body, $default_ctype = 'text/plain') } if (isset($content_type['other'])) { - while (list($p_name, $p_value) = each($content_type['other'])) { + foreach ($content_type['other'] as $p_name => $p_value) { $return->ctype_parameters[$p_name] = $p_value; } } @@ -283,7 +283,7 @@ function _decode($headers, $body, $default_ctype = 'text/plain') $content_disposition = $this->_parseHeaderValue($headers[$key]['value']); $return->disposition = $content_disposition['value']; if (isset($content_disposition['other'])) { - while (list($p_name, $p_value) = each($content_disposition['other'])) { + foreach ($content_type['other'] as $p_name => $p_value) { $return->d_parameters[$p_name] = $p_value; } } diff --git a/Mail/mimePart.php b/Mail/mimePart.php index c90a2ae04..fc7f3771a 100644 --- a/Mail/mimePart.php +++ b/Mail/mimePart.php @@ -592,7 +592,7 @@ function _quotedPrintableEncode($input , $line_max = 76) $escape = '='; $output = ''; - while (list($idx, $line) = each($lines)) { + foreach ($lines as $idx => $line) { $newline = ''; $i = 0;