Skip to content
Snippets Groups Projects
Commit 7869b2c3 authored by Rasmus Fuhse's avatar Rasmus Fuhse
Browse files

fix urlencoding

parent 9fdc929b
No related branches found
No related tags found
No related merge requests found
...@@ -187,7 +187,7 @@ class OwnCloudPlugin extends StudIPPlugin implements FilesystemPlugin { ...@@ -187,7 +187,7 @@ class OwnCloudPlugin extends StudIPPlugin implements FilesystemPlugin {
curl_close($r); curl_close($r);
$doc = new DOMDocument(); $doc = new DOMDocument();
$doc->loadXML($xml); $doc->loadXML($xml);
foreach ($doc->getElementsByTagNameNS("DAV:","response") as $file) { foreach ($doc->getElementsByTagNameNS("DAV:","response") as $file) {
foreach ($file->childNodes as $node) { foreach ($file->childNodes as $node) {
if (strtolower($node->tagName) === "d:propstat") { if (strtolower($node->tagName) === "d:propstat") {
......
...@@ -376,7 +376,12 @@ class OwncloudFolder extends VirtualFolderType { ...@@ -376,7 +376,12 @@ class OwncloudFolder extends VirtualFolderType {
if ($nodeValue[0] === "/") { if ($nodeValue[0] === "/") {
$nodeValue = substr($nodeValue, 1); $nodeValue = substr($nodeValue, 1);
} }
$path = substr($nodeValue, strpos(strtolower($nodeValue), strtolower(rawurldecode($root))) + strlen(rawurldecode($root))); $nodeValue = str_replace(array("(", ")"), array("%28", "%29"), $nodeValue); //for Owncloud only
if (strpos(rawurldecode($nodeValue), rawurldecode($root)) !== false) {
$path = substr($nodeValue, strpos(rawurldecode($nodeValue), rawurldecode($root)) + strlen($root));
} else {
$path = null;
}
$path_array = preg_split("/\//", $path, 0, PREG_SPLIT_NO_EMPTY); $path_array = preg_split("/\//", $path, 0, PREG_SPLIT_NO_EMPTY);
$file_attributes['name'] = rawurldecode(array_pop($path_array)); $file_attributes['name'] = rawurldecode(array_pop($path_array));
if (!trim($file_attributes['name']) || ($path === $this->id) || !$path) { if (!trim($file_attributes['name']) || ($path === $this->id) || !$path) {
...@@ -402,7 +407,7 @@ class OwncloudFolder extends VirtualFolderType { ...@@ -402,7 +407,7 @@ class OwncloudFolder extends VirtualFolderType {
if (strtolower($attr->tagName) === "d:displayname") { if (strtolower($attr->tagName) === "d:displayname") {
$file_attributes['name'] = $attr->nodeValue; $file_attributes['name'] = $attr->nodeValue;
} }
if ($attr->tagName === "d:getlastmodified") { if (strtolower($attr->tagName) === "d:getlastmodified") {
$file_attributes['chdate'] = strtotime($attr->nodeValue); $file_attributes['chdate'] = strtotime($attr->nodeValue);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment