|
Revision 22149, 0.8 kB
(checked in by Kris.Wallsmith, 4 years ago)
|
[1.3] added a check for sfCallable in regex validator, added protocols option to url validator, moved email pattern to class constant
|
- Property svn:mime-type set to
text/x-php
- Property svn:eol-style set to
native
- Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
class sfValidatorEmail extends sfValidatorRegex |
|---|
| 20 |
{ |
|---|
| 21 |
const REGEX_EMAIL = '/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i'; |
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
* @see sfValidatorRegex |
|---|
| 25 |
*/ |
|---|
| 26 |
protected function configure($options = array(), $messages = array()) |
|---|
| 27 |
{ |
|---|
| 28 |
parent::configure($options, $messages); |
|---|
| 29 |
|
|---|
| 30 |
$this->setOption('pattern', self::REGEX_EMAIL); |
|---|
| 31 |
} |
|---|
| 32 |
} |
|---|
| 33 |
|
|---|