summaryrefslogtreecommitdiffstats
path: root/lib/private/db
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-09-18 15:09:57 +0200
committerRobin Appelman <icewind@owncloud.com>2014-09-18 15:09:57 +0200
commita85f0ae2da4344826ee04f79bc362eb5d1a86f67 (patch)
tree6009e223a15a7fe5321a2bc2a6d0cd8f2b677fb6 /lib/private/db
parent0c03b2bdd5fd8b94e7fad657591bdc3788b99157 (diff)
downloadnextcloud-server-a85f0ae2da4344826ee04f79bc362eb5d1a86f67.tar.gz
nextcloud-server-a85f0ae2da4344826ee04f79bc362eb5d1a86f67.zip
Fix ILIKE without wildcards for oracle
Diffstat (limited to 'lib/private/db')
-rw-r--r--lib/private/db/adapteroci8.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/db/adapteroci8.php b/lib/private/db/adapteroci8.php
index fb4ea1bcde9..db7e66e7913 100644
--- a/lib/private/db/adapteroci8.php
+++ b/lib/private/db/adapteroci8.php
@@ -21,7 +21,7 @@ class AdapterOCI8 extends Adapter {
const UNIX_TIMESTAMP_REPLACEMENT = "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400";
public function fixupStatement($statement) {
- $statement = preg_replace('/`(\w+)` ILIKE \?/', 'REGEXP_LIKE(`$1`, TRIM(BOTH \'%\' FROM ?), \'i\')', $statement);
+ $statement = preg_replace('/`(\w+)` ILIKE \?/', 'REGEXP_LIKE(`$1`, \'^\' || REPLACE(?, \'%\', \'.*\') || \'$\', \'i\')', $statement);
$statement = str_replace('`', '"', $statement);
$statement = str_ireplace('NOW()', 'CURRENT_TIMESTAMP', $statement);
$statement = str_ireplace('UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement);