Re: [xml] libxml2 uri.c xmlURIEscape (with fix)



On Tue, Jul 30, 2002 at 08:34:50PM -0400, Joel Young wrote:

Hi Daniel,

I found another issue with xmlURIEscape.  It doesn't handle blanks in
the input string.  I know blanks aren't valid but that's what
xmlURIEscape is s'posed to fix.

All that is needed to fix this is to add ' ' to IS_UNWISE in uri.c:

 #define IS_UNWISE(p)                                                    \
       (((*(p) == '{')) || ((*(p) == '}')) || ((*(p) == '|')) ||         \
       ((*(p) == '\\')) || ((*(p) == '^')) || ((*(p) == '[')) ||        \
        ((*(p) == ']')) || ((*(p) == ' ')) || ((*(p) == '`')))  
 
                             ------------

What do you think?

  That UNWISE set is defined by RFC 2396 and I dislike the idea of 
changing something that fundamental. This means it also change the
semantic of URI checking when parsing new ones, and I'm not fond of that.
I would rather prefer a patch checking uri->cleanup == 1  to allow them
at parse time only when trying to do escaping.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]