URL validation - hyphens

mauri

New member
Hi,

it seems DaDaBIK 4.3_beta considers hyphen "-" as not allowed in URL's - and it is actually valid. http://www.faqs.org/rfcs/rfc2396.html specifies what is allowed, but I guess the simplest thing to do is to avoid the trouble completely by using the PHP function:

[pre]
function is_valid_url($url)
// goal: chek if an url address is valid, according to its syntax
// input: $url
// output: true if it's valid, false otherwise
{
if ( filter_var( $url, FILTER_VALIDATE_URL ) == FALSE )
return FALSE;
else
return TRUE;
} // end function is_valid_url
[/pre]


greetings
Mauri Tikka
mauri@machina.fi
 
Top