Conditions | 6 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
47 | public function isValid($input = null) |
||
48 | { |
||
49 | if (!preg_match('/^.+\@\S+\.\S+$/', $input)) { |
||
|
|||
50 | return false; |
||
51 | } |
||
52 | |||
53 | $host = substr($input, strrpos($input, '@') + 1); |
||
54 | |||
55 | if ($this->mx && !$this->checkMX($host)) { |
||
56 | $this->violations[] = 'mx'; |
||
57 | } |
||
58 | |||
59 | if ($this->host && !$this->checkHost($host)) { |
||
60 | $this->violations[] = 'host'; |
||
61 | } |
||
62 | |||
63 | return !$this->hasViolations(); |
||
64 | } |
||
90 |