aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/driver/sqlite.php
diff options
context:
space:
mode:
authorGeolim4 <contact@geolim4.com>2014-08-08 15:06:12 +0200
committerGeolim4 <contact@geolim4.com>2014-08-08 16:40:33 +0200
commit6b60153ab4ac036bcd4eaaa90806d9898fc1e9a2 (patch)
treed378a9a0aa46968a08a0f20dcbbe4b4e2c049f3a /phpBB/phpbb/db/driver/sqlite.php
parentf6da2661091a9f068956a23df7e70450cec9ee74 (diff)
downloadforums-6b60153ab4ac036bcd4eaaa90806d9898fc1e9a2.tar
forums-6b60153ab4ac036bcd4eaaa90806d9898fc1e9a2.tar.gz
forums-6b60153ab4ac036bcd4eaaa90806d9898fc1e9a2.tar.bz2
forums-6b60153ab4ac036bcd4eaaa90806d9898fc1e9a2.tar.xz
forums-6b60153ab4ac036bcd4eaaa90806d9898fc1e9a2.zip
[ticket/12671] Possibility to use NOT LIKE expression
PHPBB3-12671
Diffstat (limited to 'phpBB/phpbb/db/driver/sqlite.php')
-rw-r--r--phpBB/phpbb/db/driver/sqlite.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/phpBB/phpbb/db/driver/sqlite.php b/phpBB/phpbb/db/driver/sqlite.php
index 2112e5ba2f..841662c1ed 100644
--- a/phpBB/phpbb/db/driver/sqlite.php
+++ b/phpBB/phpbb/db/driver/sqlite.php
@@ -288,6 +288,23 @@ class sqlite extends \phpbb\db\driver\driver
}
/**
+ * {@inheritDoc}
+ *
+ * For SQLite an underscore is a not-known character... this may change with SQLite3
+ */
+ 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
* @access private
*/