summaryrefslogtreecommitdiffstats
path: root/system/libraries/Email.php
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-01-16 18:46:56 +0100
committerDerek Jones <derek.jones@ellislab.com>2008-01-16 18:46:56 +0100
commit80e1404151d718a8ac921c9825cadcd2dcfcbba4 (patch)
tree97bea905256291933a9db3cf5dfd001e9a222f4b /system/libraries/Email.php
parent17f740665b520f124d5bee352b52fbc5a195a9e4 (diff)
fixed bug #2542 - switched to foreach() in clean_email() to work with associative arrays or numerically indexed arrays that are not sequential from 0.
Diffstat (limited to 'system/libraries/Email.php')
-rw-r--r--system/libraries/Email.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 7b5ebca8c..cbf6e23f0 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -684,13 +684,17 @@ class CI_Email {
}
$clean_email = array();
-
- for ($i=0; $i < count($email); $i++)
+
+ foreach ($email as $addy)
{
- if (preg_match( '/\<(.*)\>/', $email[$i], $match))
- $clean_email[] = $match['1'];
+ if (preg_match( '/\<(.*)\>/', $addy, $match))
+ {
+ $clean_email[] = $match['1'];
+ }
else
- $clean_email[] = $email[$i];
+ {
+ $clean_email[] = $addy;
+ }
}
return $clean_email;