Fixes use of the PHP parse_url function in a way that only works on PHP5