]> source.dussan.org Git - nextcloud-server.git/commitdiff
Revert "Properly quote file names in listFiles query for GDrive"
authorLukas Reschke <lukas@owncloud.com>
Tue, 31 Mar 2015 13:12:35 +0000 (15:12 +0200)
committerLukas Reschke <lukas@owncloud.com>
Tue, 31 Mar 2015 13:12:35 +0000 (15:12 +0200)
apps/files_external/lib/google.php
tests/lib/files/storage/storage.php

index b9d3666f9563301606d149829efd8e52da77a527..291f9364ddd33b2e36b7b658cd252e746db728fb 100644 (file)
@@ -113,7 +113,7 @@ class Google extends \OC\Files\Storage\Common {
                                if (isset($this->driveFiles[$path])) {
                                        $parentId = $this->driveFiles[$path]->getId();
                                } else {
-                                       $q = "title='" . rawurlencode($name) . "' and '" . rawurlencode($parentId) . "' in parents and trashed = false";
+                                       $q = "title='".$name."' and '".$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'] = "'" . rawurlencode($folder->getId()) . "' in parents and trashed = false";
+                               $params['q'] = "'".$folder->getId()."' in parents and trashed = false";
                                $children = $this->service->files->listFiles($params);
                                foreach ($children->getItems() as $child) {
                                        $name = $child->getTitle();
index ad7522f1ea871ac049c407546ad63759a4d8da2f..30f403d60df0a42f0b07e5859fb0b2f0dd6c43c3 100644 (file)
@@ -104,14 +104,13 @@ abstract class Storage extends \Test\TestCase {
        }
 
        public function directoryProvider() {
-               return [
-                       ['folder'],
-                       [' folder'],
-                       ['folder '],
-                       ['folder with space'],
-                       ['spéciäl földer'],
-                       ['test single\'quote'],
-               ];
+               return array(
+                       array('folder'),
+                       array(' folder'),
+                       array('folder '),
+                       array('folder with space'),
+                       array('spéciäl földer'),
+               );
        }
 
        function loremFileProvider() {
@@ -164,16 +163,15 @@ abstract class Storage extends \Test\TestCase {
 
 
        public function copyAndMoveProvider() {
-               return [
-                       ['/source.txt', '/target.txt'],
-                       ['/source.txt', '/target with space.txt'],
-                       ['/source with space.txt', '/target.txt'],
-                       ['/source with space.txt', '/target with space.txt'],
-                       ['/source.txt', '/tärgét.txt'],
-                       ['/sòurcē.txt', '/target.txt'],
-                       ['/sòurcē.txt', '/tärgét.txt'],
-                       ['/single \' quote.txt', '/tar\'get.txt'],
-               ];
+               return array(
+                       array('/source.txt', '/target.txt'),
+                       array('/source.txt', '/target with space.txt'),
+                       array('/source with space.txt', '/target.txt'),
+                       array('/source with space.txt', '/target with space.txt'),
+                       array('/source.txt', '/tärgét.txt'),
+                       array('/sòurcē.txt', '/target.txt'),
+                       array('/sòurcē.txt', '/tärgét.txt'),
+               );
        }
 
        public function initSourceAndTarget ($source, $target = null) {