From 0c03b2bdd5fd8b94e7fad657591bdc3788b99157 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 17 Sep 2014 16:12:54 +0200 Subject: [PATCH] Use ILIKE in cache search --- lib/private/files/cache/cache.php | 14 +------------- 1 file changed, 1 insertion(+), 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) ); -- 2.39.5