Development

#3000: sfValidatorUrl.class.php.patch

You must first sign up to be able to contribute.

Ticket #3000: sfValidatorUrl.class.php.patch

File sfValidatorUrl.class.php.patch, 1.3 kB (added by Carl.Vondrick, 2 years ago)

Patch for sfValidatorUrl to accept the FTP protocol.

  • test/unit/validator/sfValidatorUrlTest.php

    old new  
    1010 
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(12, new lime_output_color()); 
     13$t = new lime_test(13, new lime_output_color()); 
    1414 
    1515$v = new sfValidatorUrl(); 
    1616 
     
    2323  'http://www.symfony-project.com/', 
    2424  'http://127.0.0.1/', 
    2525  'http://127.0.0.1:80/', 
     26  'ftp://google.com/foo.tgz', 
    2627) as $url) 
    2728{ 
    2829  $t->is($v->clean($url), $url, '->clean() checks that the value is a valid URL'); 
  • lib/validator/sfValidatorUrl.class.php

    old new  
    2626    parent::configure($options, $messages); 
    2727 
    2828    $this->setOption('pattern', '~^ 
    29       https?://                               # http or https 
     29      (https?|ftp)://                        # http or https or ftp 
    3030      ( 
    3131        ([a-z0-9-]+\.)+[a-z]{2,6}             # a domain name 
    3232          |                                   #  or 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.