Improved url detection with security in mind.