diff options
-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; } /** |