]> source.dussan.org Git - nextcloud-server.git/commitdiff
Added rawurlencode for other params in GDrive storage
authorVincent Petry <pvince81@owncloud.com>
Thu, 26 Mar 2015 12:57:28 +0000 (13:57 +0100)
committerVincent Petry <pvince81@owncloud.com>
Thu, 26 Mar 2015 12:57:28 +0000 (13:57 +0100)
apps/files_external/lib/google.php

index bf0fa4815b145e57e9f3b7f02b7facc2d01bf57a..47be43924ef97ebf9622aef2c0b6acdba72ba9fe 100644 (file)
@@ -103,7 +103,7 @@ class Google extends \OC\Files\Storage\Common {
                                if (isset($this->driveFiles[$path])) {
                                        $parentId = $this->driveFiles[$path]->getId();
                                } else {
-                                       $q = "title='".rawurlencode($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
@@ -247,7 +247,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();