diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-09-17 16:12:54 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-09-17 16:12:54 +0200 |
commit | 0c03b2bdd5fd8b94e7fad657591bdc3788b99157 (patch) | |
tree | 6b5b68104105150a86c4ed4a2a8eafca2205720d /lib/private/files/cache | |
parent | 67b1ec1fafaa4ca4d4343b7a3867d194509cb633 (diff) | |
download | nextcloud-server-0c03b2bdd5fd8b94e7fad657591bdc3788b99157.tar.gz nextcloud-server-0c03b2bdd5fd8b94e7fad657591bdc3788b99157.zip |
Use ILIKE in cache search
Diffstat (limited to 'lib/private/files/cache')
-rw-r--r-- | lib/private/files/cache/cache.php | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php index cfa3e916185..7ea00325a10 100644 --- a/lib/private/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -464,19 +464,7 @@ class Cache { `mimetype`, `mimepart`, `size`, `mtime`, `encrypted`, `unencrypted_size`, `etag`, `permissions` FROM `*PREFIX*filecache` - WHERE `storage` = ? AND '; - $dbtype = \OC_Config::getValue( 'dbtype', 'sqlite' ); - if($dbtype === 'oci') { - //remove starting and ending % from the pattern - $pattern = '^'.str_replace('%', '.*', $pattern).'$'; - $sql .= 'REGEXP_LIKE(`name`, ?, \'i\')'; - } else if($dbtype === 'pgsql') { - $sql .= '`name` ILIKE ?'; - } else if ($dbtype === 'mysql') { - $sql .= '`name` COLLATE utf8_general_ci LIKE ?'; - } else { - $sql .= '`name` LIKE ?'; - } + WHERE `storage` = ? AND `name` ILIKE ?'; $result = \OC_DB::executeAudited($sql, array($this->getNumericStorageId(), $pattern) ); |