summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorFrank Karlitschek <karlitschek@gmx.de>2015-03-31 09:08:59 -0400
committerFrank Karlitschek <karlitschek@gmx.de>2015-03-31 09:08:59 -0400
commitb216b3fad0517b706457f74597b1ec7a7772a2b3 (patch)
tree1ed3e2f6dfecbc86069876ed0d4ab4a83e95e8ed /apps/files_external
parent1d06d93d271210793baf575414ff0dd8f576dae0 (diff)
parent534892d45646ca9c90be9b2632dc25dc21f9038d (diff)
downloadnextcloud-server-b216b3fad0517b706457f74597b1ec7a7772a2b3.tar.gz
nextcloud-server-b216b3fad0517b706457f74597b1ec7a7772a2b3.zip
Merge pull request #15215 from owncloud/ext-gdrivelistfilequoting
Properly quote file names in listFiles query for GDrive
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/google.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php
index 291f9364ddd..b9d3666f956 100644
--- a/apps/files_external/lib/google.php
+++ b/apps/files_external/lib/google.php
@@ -113,7 +113,7 @@ class Google extends \OC\Files\Storage\Common {
if (isset($this->driveFiles[$path])) {
$parentId = $this->driveFiles[$path]->getId();
} else {
- $q = "title='".$name."' and '".$parentId."' in parents and trashed = false";
+ $q = "title='" . rawurlencode($name) . "' and '" . rawurlencode($parentId) . "' in parents and trashed = false";
$result = $this->service->files->listFiles(array('q' => $q))->getItems();
if (!empty($result)) {
// Google Drive allows files with the same name, ownCloud doesn't
@@ -257,7 +257,7 @@ class Google extends \OC\Files\Storage\Common {
if ($pageToken !== true) {
$params['pageToken'] = $pageToken;
}
- $params['q'] = "'".$folder->getId()."' in parents and trashed = false";
+ $params['q'] = "'" . rawurlencode($folder->getId()) . "' in parents and trashed = false";
$children = $this->service->files->listFiles($params);
foreach ($children->getItems() as $child) {
$name = $child->getTitle();