[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: rev 370 - trunk/subversion/mod_dav_svn

From: Greg Stein <gstein_at_lyra.org>
Date: 2001-11-01 23:06:21 CET

On Thu, Nov 01, 2001 at 12:54:03PM -0600, kfogel@tigris.org wrote:
>...
> @@ -101,7 +94,15 @@
> "<S:date>%s</S:date>" DEBUG_CR
> "<D:comment>%s</D:comment>" DEBUG_CR
> "</S:log-item>" DEBUG_CR,
> - rev, escaped_author->data, escaped_date->data, escaped_msg->data);
> + rev,
> + /* ### The `1' in the calls below means replace `"' with
> + `"'. This seems safe to me, since the dequoter on
> + the other side will certainly handle it. But is it
> + necessary? I dunno. */
> + apr_xml_quote_string(lrb->pool, author, 1),
> + apr_xml_quote_string(lrb->pool, date, 1),
> + apr_xml_quote_string(lrb->pool, msg, 1));

The double-quote character does not need to be quoted. CDATA sections in XML
can contain (double) quotes without problem. That parameter is intended for
when you put a value into an XML *attribute*. The assumption is that you
surround the attribute vlaue with double-quotes, so all double-quotes inside
should be quoted.

For example:

  <element attr="quote "stuff" in <here>">
    but not the "stuff" in <here>
  </element>

Net result: you can (IMO, should) pass 0 for that second parameter. The
quote_string function won't have to work as hard then.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:47 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.