Welcome Guest, Not a member yet? Register   Sign In
validation prep_url patch
#1

[eluser]ReGeDa[/eluser]
i've patched it such as:
Code:
function prep_url($str = '')
{
    if ($str == 'http://' OR $str == '')
    {
        $_POST[$this->_current_field] = '';
        return;
    }
    
    //++ @PATCH
    
    if (! preg_match('/^((http|ftp)[s]?:\/{2}|mailto:)(.+)$/u',$str))
        $str = $str = 'http://'.$str;
        
    /*
    if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://')
    {
        $str = 'http://'.$str;
    }
    */
    //-- @PATCH
    
    $_POST[$this->_current_field] = $str;
}




Theme © iAndrew 2016 - Forum software by © MyBB