This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
szurubooru/src/Services/EmailService.php
2014-10-18 18:48:17 +02:00

15 lines
303 B
PHP

<?php
namespace Szurubooru\Services;
class EmailService
{
//todo: refactor this to generic validation
public function validateEmail($email)
{
if (!$email)
return;
if (!preg_match('/^[^@]+@[^@]+\.\w+$/', $email))
throw new \DomainException('Specified e-mail appears to be invalid.');
}
}