mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-29 18:26:05 +00:00
Improved formatting of namespace details for arbitrary properties.
This commit is contained in:
parent
1f5dad92f0
commit
60383ef3c2
@ -336,7 +336,15 @@ function collection_to_xml( $collection ) {
|
||||
|
||||
if ( count($collection->properties) > 0 ) {
|
||||
foreach( $collection->properties AS $k => $v ) {
|
||||
$prop->NewElement($k, $v );
|
||||
if ( preg_match('/^(.*):([^:]+)$/', $k, $matches) ) {
|
||||
$namespace = $matches[1];
|
||||
$tag = $matches[2];
|
||||
}
|
||||
else {
|
||||
$namespace = "";
|
||||
$tag = $k;
|
||||
}
|
||||
$prop->NewElement(strtolower($tag), $v, array("xmlns" => strtolower($namespace)) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<propstat>
|
||||
<prop>
|
||||
<displayname>User One's Calendar</displayname>
|
||||
<URN:MCMILLAN:BOGUS:XML:NS:RSCDS:ARBITRARY>A completely bogus property which should be saved.</URN:MCMILLAN:BOGUS:XML:NS:RSCDS:ARBITRARY>
|
||||
<arbitrary xmlns="urn:mcmillan:bogus:xml:ns:rscds">A completely bogus property which should be saved.</arbitrary>
|
||||
</prop>
|
||||
<status>HTTP/1.1 200 OK</status>
|
||||
</propstat>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user