aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/driver/sqlite3.php
diff options
context:
space:
mode:
authorGeolim4 <contact@geolim4.com>2014-08-08 18:32:17 +0200
committerGeolim4 <contact@geolim4.com>2014-08-08 18:32:17 +0200
commit01943adbf72e137b9dfbda3ac85120c21a30fab8 (patch)
tree11d9ecde2da1bb4e7cdab672d7856e5a1bcba603 /phpBB/phpbb/db/driver/sqlite3.php
parent6b60153ab4ac036bcd4eaaa90806d9898fc1e9a2 (diff)
downloadforums-01943adbf72e137b9dfbda3ac85120c21a30fab8.tar
forums-01943adbf72e137b9dfbda3ac85120c21a30fab8.tar.gz
forums-01943adbf72e137b9dfbda3ac85120c21a30fab8.tar.bz2
forums-01943adbf72e137b9dfbda3ac85120c21a30fab8.tar.xz
forums-01943adbf72e137b9dfbda3ac85120c21a30fab8.zip
[ticket/12671] Possibility to use NOT LIKE expression
PHPBB3-12671
Diffstat (limited to 'phpBB/phpbb/db/driver/sqlite3.php')
-rw-r--r--phpBB/phpbb/db/driver/sqlite3.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php
index 0922229e0a..f79245afb1 100644
--- a/phpBB/phpbb/db/driver/sqlite3.php
+++ b/phpBB/phpbb/db/driver/sqlite3.php
@@ -275,6 +275,23 @@ class sqlite3 extends \phpbb\db\driver\driver
}
/**
+ * {@inheritDoc}
+ *
+ * For SQLite an underscore is a not-known character...
+ */
+ public function sql_not_like_expression($expression)
+ {
+ // Unlike LIKE, GLOB is case sensitive (unfortunatly). SQLite users need to live with it!
+ // We only catch * and ? here, not the character map possible on file globbing.
+ $expression = str_replace(array(chr(0) . '_', chr(0) . '%'), array(chr(0) . '?', chr(0) . '*'), $expression);
+
+ $expression = str_replace(array('?', '*'), array("\?", "\*"), $expression);
+ $expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression);
+
+ return 'GLOB \'' . $this->sql_escape($expression) . '\'';
+ }
+
+ /**
* return sql error array
*
* @return array