URL::addEscapeChars is incorrect


#1

Hi Jules,
I was attempting to use URL::addEscapeChars to clean up paths such as http://domain/path but it appear it doesn’t accept neither : nor / as legal characters.
I’m pretty sure the :// and / should usually be left alone. An URL does specify protocol: http://en.wikipedia.org/wiki/Uniform_resource_locator

I’m under the impression that : is encoded only if it’s not part of the protocol and port specifier, and / if it’s not part of a path delimiter.


#2

The function encodes strings so they can be added to a URL - i.e. it removes any special characters like ‘/’ and ‘:’ so that the string can be safely added as e.g. a GET parameter. I don’t quite understand what you’re trying to do, but I don’t think it’s what this function is designed for.


#3

After composing the URL as a String I intended to run the whole thing through URL::addEscapeChars since the function name sounded good for that.
Reading your implementation it seem more appropriate for just the last section of the URL. I’m happy with doing just that, but
I personally think the member name is a bit confusing.