diff --git a/webservice/atompub/cmis/KT_cmis_atom_server.services.inc.php b/webservice/atompub/cmis/KT_cmis_atom_server.services.inc.php index 4f7d855..9c7ca8c 100644 --- a/webservice/atompub/cmis/KT_cmis_atom_server.services.inc.php +++ b/webservice/atompub/cmis/KT_cmis_atom_server.services.inc.php @@ -190,12 +190,11 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { // /folder/// // also possible that there will be an existing ObjectId property, try to cater for both until we know how it really works // NOTE this also applies to the source folder id, see above - // check for existing object id as parameter in url - // if sourceFolderId parameter is submitted (expected as parameter 3, or params[2]) then this is a move - if (isset($this->params[2])) { + // if sourceFolderId parameter is submitted (expected as $_GET['sourceFolderId']) then this is a move + if (isset($_GET['sourceFolderId'])) { $action = 'move'; - $sourceFolderId = $this->params[2]; + $sourceFolderId = $_GET['sourceFolderId']; } // get object properties - todo send through original properties array and not modified version @@ -364,7 +363,6 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { // TODO how will client request depth? for now we assume as part of the url - will probably be covered by URI templates if (isset($this->params[2])) { $entries = $NavigationService->getDescendants($repositoryId, $folderId, $this->params[2]); - } else { $entries = $NavigationService->getDescendants($repositoryId, $folderId); diff --git a/webservice/classes/atompub/KT_atom_server.inc.php b/webservice/classes/atompub/KT_atom_server.inc.php index ee001aa..65c007c 100644 --- a/webservice/classes/atompub/KT_atom_server.inc.php +++ b/webservice/classes/atompub/KT_atom_server.inc.php @@ -25,7 +25,11 @@ class KT_atom_server { */ public function execute(){ $reqMethod=trim(strtoupper($_SERVER['REQUEST_METHOD'])); - $queryArray=split('/',trim($_SERVER['QUERY_STRING'],'/')); + // Use preg_split to split on both / and & characters, for hybrid uri format + // e.g. ?dms/servicename/id&arg=val will be extracted to [dms], [id], [arg=val] + // This is mainly so that we properly extract the initial parameters, the remainder + // could be extracted from the $_GET array anyway, this is just making things cleaner + $queryArray=preg_split('/\/|&/',trim($_SERVER['QUERY_STRING'],'/')); $rawRequest=@file_get_contents('php://input'); $workspace=strtolower(trim($queryArray[0]));