fixed bug #2542 - switched to foreach() in clean_email() to work with associative arrays or numerically indexed arrays that are not sequential from 0.
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 7b5ebca..cbf6e23 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -684,13 +684,17 @@
}
$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;