drop default $position argument from BuildXMLTree everywhere (awl!22)

This commit is contained in:
Florian Schlichting 2023-02-26 20:49:32 +01:00
parent 8fbab49f0d
commit 4b7abbbd83
10 changed files with 10 additions and 19 deletions

View File

@ -737,8 +737,7 @@ EOQRY;
}
}
xml_parser_free($xml_parser);
$position = 0;
$xmltree = BuildXMLTree( $xml_tags, $position);
$xmltree = BuildXMLTree( $xml_tags );
return $xmltree->GetContent();
}

View File

@ -47,8 +47,7 @@ ERROR;
if ( !isset($request->xml_tags) )
errorResponse( 406, translate("Body contains no XML data!") );
$position = 0;
$xmltree = BuildXMLTree( $request->xml_tags, $position);
$xmltree = BuildXMLTree( $request->xml_tags );
if ( !is_object($xmltree) )
errorResponse( 406, translate("REPORT body is not valid XML data!") );

View File

@ -88,8 +88,7 @@ $resource = new DAVResource( $request->path );
would allow unauthenticated access to resources.
*/
$position = 0;
$xmltree = BuildXMLTree( $request->xml_tags, $position);
$xmltree = BuildXMLTree( $request->xml_tags );
$aces = $xmltree->GetPath("/DAV::acl/*");
$grantor = new DAVResource($request->path);

View File

@ -28,8 +28,7 @@ if ( ! $parent->Exists() || $parent->IsSchedulingCollection() ) {
require_once('XMLDocument.php');
$reply = new XMLDocument(array( 'DAV:' => '' ));
$position = 0;
$xmltree = BuildXMLTree( $request->xml_tags, $position);
$xmltree = BuildXMLTree( $request->xml_tags );
$segment = $xmltree->GetElements('DAV::segment');
$segment = $segment[0]->GetContent();

View File

@ -52,8 +52,7 @@ if ( isset($request->xml_tags) ) {
/**
* The MKCOL request may contain XML to set some DAV properties
*/
$position = 0;
$xmltree = BuildXMLTree( $request->xml_tags, $position);
$xmltree = BuildXMLTree( $request->xml_tags );
if ( $xmltree->GetNSTag() == 'DAV::mkcol' ) $request_type = 'extended-mkcol';
if ( $xmltree->GetNSTag() != 'urn:ietf:params:xml:ns:caldav:mkcalendar' && $request_type != 'extended-mkcol' ) {

View File

@ -34,7 +34,7 @@ if ( ! isset($request->xml_tags) ) {
$request->XMLResponse( 400, new XMLElement( 'error', new XMLElement('missing-xml-for-request'), $reply->GetXmlNsArray() ) );
}
$xmltree = BuildXMLTree( $request->xml_tags, $position);
$xmltree = BuildXMLTree( $request->xml_tags );
if ( $xmltree->GetNSTag() != 'http://www.xythos.com/namespaces/StorageServer:ticketinfo' &&
$xmltree->GetNSTag() != 'DAV::ticketinfo' ) {
$request->XMLResponse( 400, new XMLElement( 'error', new XMLElement('invalid-xml-for-request'), $reply->GetXmlNsArray() ) );

View File

@ -23,8 +23,7 @@ if ( !isset($request->xml_tags) ) {
$property_list = array('DAV::allprop');
}
else {
$position = 0;
$xmltree = BuildXMLTree( $request->xml_tags, $position);
$xmltree = BuildXMLTree( $request->xml_tags );
if ( !is_object($xmltree) ) {
$request->DoResponse( 403, translate("Request body is not valid XML data!") );
}

View File

@ -21,8 +21,7 @@ if ( !$dav_resource->HavePrivilegeTo('DAV::write-properties') ) {
}
}
$position = 0;
$xmltree = BuildXMLTree( $request->xml_tags, $position);
$xmltree = BuildXMLTree( $request->xml_tags );
// echo $xmltree->Render();

View File

@ -26,8 +26,7 @@ if ( ! ini_get('open_basedir') && (isset($c->dbg['ALL']) || (isset($c->dbg['repo
if ( !isset($request->xml_tags) ) {
$request->DoResponse( 406, translate("REPORT body contains no XML data!") );
}
$position = 0;
$xmltree = BuildXMLTree( $request->xml_tags, $position);
$xmltree = BuildXMLTree( $request->xml_tags );
if ( !is_object($xmltree) ) {
$request->DoResponse( 406, translate("REPORT body is not valid XML data!") );
}

View File

@ -70,8 +70,7 @@ function fetch_remote_list($base_url ) {
xml_get_current_line_number($xml_parser), xml_get_current_column_number($xml_parser) ));
}
xml_parser_free($xml_parser);
$position = 0;
return BuildXMLTree( $xml_tags, $position);
return BuildXMLTree( $xml_tags );
}
function fetch_remote_zone( $base_url, $tzid ) {