Ticket #3000: sfValidatorUrl.class.php.patch
| File sfValidatorUrl.class.php.patch, 1.3 kB (added by Carl.Vondrick, 2 years ago) |
|---|
-
test/unit/validator/sfValidatorUrlTest.php
old new 10 10 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(1 2, new lime_output_color());13 $t = new lime_test(13, new lime_output_color()); 14 14 15 15 $v = new sfValidatorUrl(); 16 16 … … 23 23 'http://www.symfony-project.com/', 24 24 'http://127.0.0.1/', 25 25 'http://127.0.0.1:80/', 26 'ftp://google.com/foo.tgz', 26 27 ) as $url) 27 28 { 28 29 $t->is($v->clean($url), $url, '->clean() checks that the value is a valid URL'); -
lib/validator/sfValidatorUrl.class.php
old new 26 26 parent::configure($options, $messages); 27 27 28 28 $this->setOption('pattern', '~^ 29 https?:// # http or https29 (https?|ftp):// # http or https or ftp 30 30 ( 31 31 ([a-z0-9-]+\.)+[a-z]{2,6} # a domain name 32 32 | # or

