You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2012/10/18 22:00:41 UTC
svn commit: r1399824 - in /subversion/trunk/subversion:
libsvn_ra_serf/property.c mod_dav_svn/deadprops.c
Author: cmpilato
Date: Thu Oct 18 20:00:41 2012
New Revision: 1399824
URL: http://svn.apache.org/viewvc?rev=1399824&view=rev
Log:
Detect a situation where we *still* can't use the extensible property
namespaces (because the original property name ends with a colon) and
just fall back to old handling. Man, the WebDAV spec really botched
this one... CDATA's where it's at for user-generated data!
* subversion/libsvn_ra_serf/property.c
(svn_ra_serf__wirename_from_svnname): Use old ns/name handling
rather than generating a pair that will result in name-less XML
tag getting put onto the wire.
* subversion/mod_dav_svn/deadprops.c
(propname_to_davname): Same here.
Modified:
subversion/trunk/subversion/libsvn_ra_serf/property.c
subversion/trunk/subversion/mod_dav_svn/deadprops.c
Modified: subversion/trunk/subversion/libsvn_ra_serf/property.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/property.c?rev=1399824&r1=1399823&r2=1399824&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/property.c Thu Oct 18 20:00:41 2012
@@ -888,6 +888,21 @@ svn_ra_serf__wirename_from_svnname(const
*name = apr_pstrdup(result_pool, svnname);
}
}
+
+ /* Special case: an empty "name" (which happens if the original
+ property name ends with a colon) is going to cause problems for
+ even non-strict XML parsers. Until we have a better solution,
+ we'll fall back to old-school handling in such a case. This will
+ result in XML that strict parsers will complain about, but better
+ to break only some clients than all of them.
+
+ [http://subversion.tigris.org/issues/show_bug.cgi?id=1971]
+ */
+ if (! *name)
+ {
+ *ns = SVN_DAV_PROP_NS_CUSTOM;
+ *name = apr_pstrdup(result_pool, svnname);
+ }
}
const char *
Modified: subversion/trunk/subversion/mod_dav_svn/deadprops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/deadprops.c?rev=1399824&r1=1399823&r2=1399824&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/deadprops.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/deadprops.c Thu Oct 18 20:00:41 2012
@@ -173,6 +173,21 @@ propname_to_davname(const char *propname
}
}
+ /* Special case: an empty "name" (which happens if the original
+ property name ends with a colon) is going to cause problems for
+ even non-strict XML parsers. Until we have a better solution,
+ we'll fall back to old-school handling in such a case. This will
+ result in XML that strict parsers will complain about, but better
+ to break only some clients than all of them.
+
+ [http://subversion.tigris.org/issues/show_bug.cgi?id=1971]
+ */
+ if (! davname->name[0])
+ {
+ davname->ns = SVN_DAV_PROP_NS_CUSTOM;
+ davname->name = apr_pstrdup(pool, propname);
+ }
+
return davname;
}