Function toValidURL

Returns URL sanitized and safe for usage in places such as iframe's src attribute or href attributes.