Commit f3d419b7 authored by Dries's avatar Dries

- Fixed bug #6697: improved the URL validation function

parent 0b876c44
......@@ -563,10 +563,10 @@ function valid_email_address($mail) {
*/
function valid_url($url, $absolute = false) {
if ($absolute) {
return preg_match("/^http:\/\/[a-zA-z0-9\/:_\-_\.,]+$/", $url);
return preg_match("/^(http|https|ftp):\/\/[a-z0-9\/:_\-_\.\?,~=#&]+$/i", $url);
}
else {
return preg_match("/^[a-zA-z0-9\/:_\-_\.,]+$/", $url);
return preg_match("/^[a-z0-9\/:_\-_\.,]+$/i", $url);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment