parse_url  may return false

#2260, #2261 (which are identical)
A little less code

a little more action please
Merge pull request #2274 from bleistivt/Patch-UrlCompare

parse_url  may return false