From 8edb7a6b9d2388a4095f3fee710f51c6d22ec9ed Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sat, 9 Dec 2006 21:53:39 +1300 Subject: [PATCH] Might as well do the if statement in there as well. --- inc/CalDAVRequest.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index fa675568..d84b5263 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -377,15 +377,17 @@ class CalDAVRequest * @param array $unsupported An array of the properties we don't support. */ function UnsupportedRequest( $unsupported ) { - $badprops = new XMLElement( "prop" ); - foreach( $unsupported AS $k => $v ) { - // Not supported at this point... - dbg_error_log("ERROR", " %s: Support for $v:$k properties is not implemented yet", $this->method ); - $badprops->NewElement(strtolower($k),false,array("xmlns" => strtolower($v))); - } - $error = new XMLElement("error", new XMLElement( "LOCK",$badprops), array("xmlns" => "DAV:") ); + if ( isset($unsupported) && count($unsupported) > 0 ) { + $badprops = new XMLElement( "prop" ); + foreach( $unsupported AS $k => $v ) { + // Not supported at this point... + dbg_error_log("ERROR", " %s: Support for $v:$k properties is not implemented yet", $this->method ); + $badprops->NewElement(strtolower($k),false,array("xmlns" => strtolower($v))); + } + $error = new XMLElement("error", new XMLElement( "LOCK",$badprops), array("xmlns" => "DAV:") ); - $this->DoResponse( 422, $error->Render(0,''), 'text/xml; charset="utf-8"'); + $this->DoResponse( 422, $error->Render(0,''), 'text/xml; charset="utf-8"'); + } }