Welcome Guest, Not a member yet? Register   Sign In
A little problem with valid_url
#1

[eluser]Unknown[/eluser]
Hello! It's my first message. I'm developping my first project in codeigniter.

I found 1 problem.

The filter of url in the form doesn't work with codeigniter 2.0.3:
Code:
$this->load->library('form_validation');
$this->form_validation->set_rules('url', 'Url', 'valid_url');

but is defined in the form_validation_lang.php

Code:
$lang['valid_url'] = "The %s field must contain a valid URL.";

I added this function in
Code:
/**
    * Validate URL Address
    *
    * @access    public
    * @param    string
    * @return    bool
    */
    function valid_url($str)
    {
        return (bool) filter_var($str, FILTER_VALIDATE_URL);
    }

and now it work correctly (in PHP 5.3). It's a bug o I have to implement it?

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB