12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace Cube\Validate;
- class Url extends AbstractValidate
- {
- protected $_message = "'%s' does not contain a valid URL.";
-
- public function isValid()
- {
- $value = $this->getValue();
- if (empty($value)) {
- return true;
- }
- if (!preg_match('#^\S+://\S+$#', $value)) {
- return false;
- }
- return true;
- }
- }
|