Skip to content

Commit

Permalink
dev/core#117 Replace useage of deprecated function each with foreach …
Browse files Browse the repository at this point in the history
…in Mail/mime Mail/mimePart and Mail/mimeDecode
  • Loading branch information
seamuslee001 committed May 17, 2018
1 parent c947829 commit 482441f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Mail/mime.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions Mail/mimeDecode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']) {

Expand All @@ -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;
}
}
Expand All @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Mail/mimePart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 482441f

Please sign in to comment.