diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-12-18 18:02:58 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-12-18 18:02:58 -0200 |
commit | 686e84172e7eda2dea4b187089d77524a69ac4e8 (patch) | |
tree | d1586f11cb1c578bdccbf1af92cbb3feb2ca8cb1 | |
parent | 43c4c15a33dfcb610a28fe802ce6086447471ca5 (diff) | |
download | reminder-686e84172e7eda2dea4b187089d77524a69ac4e8.tar.gz reminder-686e84172e7eda2dea4b187089d77524a69ac4e8.tar.bz2 |
-rw-r--r-- | reminder.module | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/reminder.module b/reminder.module index b3a550a..1954a21 100644 --- a/reminder.module +++ b/reminder.module @@ -453,11 +453,18 @@ function reminder_send($nid) { /** * Helper function to parse subscribers. * - * @todo - * Ignore blank lines. + * @see http://stackoverflow.com/questions/1028553/how-to-get-email-address-from-a-long-string */ function reminder_parse_subscribers($subscribers) { - return explode("\n", $subscribers); + foreach(preg_split('/ |,|;|\n/', $subscribers) as $token) { + $email = filter_var(filter_var($token, FILTER_SANITIZE_EMAIL), FILTER_VALIDATE_EMAIL); + + if ($email !== false) { + $emails[] = $email; + } + } + + return $emails; } /** |