stripping parameters off end of url in sanitizeUrl