summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-06-28 11:26:04 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-06-28 11:26:04 +0200
commitb52ed2496748d26453ad9889c7bb75ef11d3c739 (patch)
treeccb2047a645b58a6d4a30e5a4065b62d3e75013e
parent9758c104b781f2dc2ac0bac1265303ac9f3bedef (diff)
parent94e9efeee78101f62eccc00a8bbe63ed2da92131 (diff)
downloadnextcloud-server-b52ed2496748d26453ad9889c7bb75ef11d3c739.tar.gz
nextcloud-server-b52ed2496748d26453ad9889c7bb75ef11d3c739.zip
Merge pull request #9229 from owncloud/fix_search_on_oracle_stable5
replace % in pattern with .* and surround with ^$ to get a real regex pattern
-rw-r--r--lib/files/cache/cache.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php
index 3bf0724143d..a2832296436 100644
--- a/lib/files/cache/cache.php
+++ b/lib/files/cache/cache.php
@@ -521,7 +521,8 @@ class Cache {
WHERE `storage` = ? AND ';
if(\OC_Config::getValue( 'dbtype', 'sqlite' ) === 'oci') {
//remove starting and ending % from the pattern
- $pattern = trim($pattern, '%');
+ $pattern = preg_quote($pattern);
+ $pattern = '^'.str_replace('%', '.*', $pattern).'$';
$sql .= 'REGEXP_LIKE(`name`, ?, \'i\')';
} else {
$sql .= '`name` LIKE ?';