apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: opposite of apr_xml_quote_string() ?
Date Wed, 09 Mar 2005 17:37:11 GMT
On Wed, Mar 09, 2005 at 05:16:42PM +0000, Joe Orton wrote:
> On Wed, Mar 09, 2005 at 10:56:46AM -0600, Ben Collins-Sussman wrote:
> > 3. Meanwhile, back in httpd, here's the incoming lock that mod_dav is
> >    handing to mod_dav_svn, expecting it to be stored in the repository:
> > 
> > (gdb) p *dlock
> > $1 = {
> >   rectype = DAV_LOCKREC_DIRECT,
> >   is_locknull = 1,
> >   scope = DAV_LOCKSCOPE_EXCLUSIVE,
> >   type = DAV_LOCKTYPE_WRITE,
> >   depth = 0,
> >   timeout = 0,
> >   locktoken = 0x18d7e90,
> >   owner = 0x18d7f38 "<ns0:owner xmlns:ns0=\"DAV:\">this &lt;is&gt;
a 
> > comment.</ns0:owner>",
> >   auth_user = 0x18d7f90 "sussman",
> >   info = 0x0,
> >   next = 0x0
> > }
> > 
> >        ... sure looks like the comment is still xml-escaped!
> > 
> > So... how is this possible?
> 
> Ah; gotcha, sorry, my mistake, it's because mod_dav is re-escaping it; I
> missed this when grepping earlier - dav_lock_parse_lockinfo has:
> 
>             /* quote all the values in the <DAV:owner> element */
>             apr_xml_quote_elem(p, child);
> 
> which is necessary by design I expect.

Could you just pass this lock->owner string back through the XML parser? 
apr_xml_to_text should guarantee it's well-formed, I think.  I'm not
sure adding an "XML unquoting" function to APR just for this is a great
idea; it's such a contrived situation that requires it.  Another
alternative would be to enhance the mod_dav API such that you can get to
the stuff unquoted as well.

joe


Mime
View raw message