aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/driver/sqlite.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-08-10 13:35:27 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-08-10 13:35:27 +0200
commitb3ca955fb598cb3afa4becd6eae84c620649e08d (patch)
tree30ea814ef3092e7fca914aa52fb8c774848e0240 /phpBB/phpbb/db/driver/sqlite.php
parent707568c49639930632b64099b0182ebc8deb1194 (diff)
parentdb0815f680d4ed9da845facb6e8e3975ac14621e (diff)
downloadforums-b3ca955fb598cb3afa4becd6eae84c620649e08d.tar
forums-b3ca955fb598cb3afa4becd6eae84c620649e08d.tar.gz
forums-b3ca955fb598cb3afa4becd6eae84c620649e08d.tar.bz2
forums-b3ca955fb598cb3afa4becd6eae84c620649e08d.tar.xz
forums-b3ca955fb598cb3afa4becd6eae84c620649e08d.zip
Merge pull request #2837 from Geolim4/ticket/12671
Ticket/12671 Possibility to use NOT LIKE expression * Geolim4/ticket/12671: [ticket/12671] Possibility to use NOT LIKE expression [ticket/12671] Possibility to use NOT LIKE expression [ticket/12671] Possibility to use NOT LIKE expression [ticket/12671] Possibility to use NOT LIKE expression [ticket/12671] Possibility to use NOT LIKE expression
Diffstat (limited to 'phpBB/phpbb/db/driver/sqlite.php')
-rw-r--r--phpBB/phpbb/db/driver/sqlite.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/phpBB/phpbb/db/driver/sqlite.php b/phpBB/phpbb/db/driver/sqlite.php
index 2112e5ba2f..d5da0e2438 100644
--- a/phpBB/phpbb/db/driver/sqlite.php
+++ b/phpBB/phpbb/db/driver/sqlite.php
@@ -277,7 +277,7 @@ class sqlite extends \phpbb\db\driver\driver
*/
function sql_like_expression($expression)
{
- // Unlike LIKE, GLOB is case sensitive (unfortunatly). SQLite users need to live with it!
+ // Unlike LIKE, GLOB is unfortunately case sensitive.
// 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);
@@ -288,6 +288,23 @@ class sqlite extends \phpbb\db\driver\driver
}
/**
+ * {@inheritDoc}
+ *
+ * For SQLite an underscore is a not-known character...
+ */
+ function sql_not_like_expression($expression)
+ {
+ // Unlike NOT LIKE, NOT GLOB is unfortunately case sensitive.
+ // 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 'NOT GLOB \'' . $this->sql_escape($expression) . '\'';
+ }
+
+ /**
* return sql error array
* @access private
*/