szurubooru/src/Services/EmailService.php

15 lines
258 B
PHP
Raw Normal View History

2014-08-31 16:57:59 +02:00
<?php
namespace Szurubooru\Services;
class EmailService
{
public function validateEmail($email)
{
if (!$email)
return;
if (!preg_match('/^[^@]+@[^@]+\.\w+$/', $email))
throw new \DomainException('Specified e-mail appears to be invalid.');
}
}