|
Revision 9048, 1.2 kB
(checked in by FabianLange, 5 years ago)
|
1.1: fixed @param phpdoc to fit specs in validator (refs #2991)
|
- 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 sfValidatorUrl extends sfValidatorRegex |
|---|
| 20 |
{ |
|---|
| 21 |
|
|---|
| 22 |
* @param array $options An array of options |
|---|
| 23 |
* @param array $messages An array of error messages |
|---|
| 24 |
* |
|---|
| 25 |
* @see sfValidatorRegex |
|---|
| 26 |
*/ |
|---|
| 27 |
protected function configure($options = array(), $messages = array()) |
|---|
| 28 |
{ |
|---|
| 29 |
parent::configure($options, $messages); |
|---|
| 30 |
|
|---|
| 31 |
$this->setOption('pattern', '~^ |
|---|
| 32 |
(https?|ftps?):// # http or ftp (+SSL) |
|---|
| 33 |
( |
|---|
| 34 |
([a-z0-9-]+\.)+[a-z]{2,6} # a domain name |
|---|
| 35 |
| # or |
|---|
| 36 |
\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # a IP address |
|---|
| 37 |
) |
|---|
| 38 |
(:[0-9]+)? # a port (optional) |
|---|
| 39 |
(/?|/\S+) # a /, nothing or a / with something |
|---|
| 40 |
$~ix'); |
|---|
| 41 |
} |
|---|
| 42 |
} |
|---|
| 43 |
|
|---|