BaseValidator.php
1 year ago
CharacterLength.php
2 years ago
DateTime.php
2 years ago
Email.php
2 years ago
Exception.php
2 years ago
IdSite.php
2 years ago
IpRanges.php
2 years ago
NotEmpty.php
2 years ago
NumberRange.php
2 years ago
Regex.php
1 year ago
UrlLike.php
2 years ago
WhitelistedValue.php
1 year ago
Email.php
24 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Matomo - free/libre analytics platform |
| 5 | * |
| 6 | * @link https://matomo.org |
| 7 | * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 8 | */ |
| 9 | namespace Piwik\Validators; |
| 10 | |
| 11 | use Piwik\Piwik; |
| 12 | class Email extends \Piwik\Validators\BaseValidator |
| 13 | { |
| 14 | public function validate($value) |
| 15 | { |
| 16 | if ($this->isValueBare($value)) { |
| 17 | return; |
| 18 | } |
| 19 | if (!Piwik::isValidEmailString($value)) { |
| 20 | throw new \Piwik\Validators\Exception(Piwik::translate('General_ValidatorErrorNotEmailLike', array($value))); |
| 21 | } |
| 22 | } |
| 23 | } |
| 24 |