start better validation
Switch to regexp from dperini
The PHP filter function validates completely invalid URIs such as "http://http://". This regexp is very reliable. See regexp comparisons here: http://mathiasbynens.be/demo/url-regex