diff --git a/README.md b/README.md new file mode 100644 index 0000000..a4a7591 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +chemistry-phpclient +=================== + +Mirror of Apache Chemistry PHPClient diff --git a/atom/cmis/cmis_service.php b/atom/cmis/cmis_service.php index e52b384..91d7fc3 100644 --- a/atom/cmis/cmis_service.php +++ b/atom/cmis/cmis_service.php @@ -690,7 +690,7 @@ function processPropertyTemplates($objectType, $propMap) { $hash_values['properties'] .= $val; } } else { - $hash_values['properties'] = $propValue; + $hash_values['properties'] = htmlentities($propValue); } //echo "HASH:\n"; //print_r(array("template" =>$propTemplate, "Hash" => $hash_values)); @@ -926,7 +926,7 @@ function postObject($folderId,$objectName,$objectType,$properties=array(),$conte if (!isset($hash_values["cmis:objectTypeId"])) { $hash_values["cmis:objectTypeId"]=$objectType; } - $properties_xml = $this->processPropertyTemplates($objectType,$hash_values); + $properties_xml = $this->processPropertyTemplates($hash_values["cmis:objectTypeId"],$hash_values); if (is_array($options)) { $hash_values=$options; } else { @@ -1055,10 +1055,10 @@ function updateProperties($objectId, $properties = array (), $options = array () $hash_values = array_merge($fixed_hash_values, $hash_values); if (!isset($hash_values['title'])) { - $hash_values['title'] = $objectName; + $hash_values['title'] = preg_replace("/[^A-Za-z0-9\s.&; ]/", '', htmlentities($objectName)); } if (!isset($hash_values['summary'])) { - $hash_values['summary'] = $objectName; + $hash_values['summary'] = preg_replace("/[^A-Za-z0-9\s.&; ]/", '', htmlentities($objectName)); } $put_value = CMISRepositoryWrapper :: processTemplate($entry_template, $hash_values); $ret = $this->doPut($obj_url, $put_value, MIME_ATOM_XML_ENTRY); @@ -1280,4 +1280,4 @@ function getACL() { function applyACL() { throw new CmisNotImplementedException("applyACL"); } -} \ No newline at end of file +} diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..1501eb7 --- /dev/null +++ b/composer.json @@ -0,0 +1,3 @@ +{ + "name": "apache/chemistry-phpclient" +}