summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-04-01 10:35:39 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-04-01 10:35:39 +0200
commit297e29248df402f76b36164b80722194bbc9b747 (patch)
tree6a272a6bd6aa03d03f6d58a12e49c7a240fba6cf /apps
parentc89cf92747cdc77d2e74faa9494d27e9e04089d2 (diff)
parentc052ee75844bbd947e7466eda1f1dcda1ed43950 (diff)
downloadnextcloud-server-297e29248df402f76b36164b80722194bbc9b747.tar.gz
nextcloud-server-297e29248df402f76b36164b80722194bbc9b747.zip
Merge pull request #15336 from owncloud/revive-15215
Properly quote file names in listFiles query for GDrive
Diffstat (limited to 'apps')
-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..541113fb530 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='" . str_replace("'","\\'", $name) . "' and '" . str_replace("'","\\'", $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'] = "'" . str_replace("'","\\'", $folder->getId()) . "' in parents and trashed = false";
$children = $this->service->files->listFiles($params);
foreach ($children->getItems() as $child) {
$name = $child->getTitle();