Modified the URL escaping function to whitelist only http and https URLs