aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/driver/sqlite3.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-08-10 13:35:37 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-08-10 13:35:37 +0200
commit489aba31c70c2b7ccafdd6941a4d2077afef0967 (patch)
treeaf96b4e8f806f345308b0c5b7124e71a16a9b06d /phpBB/phpbb/db/driver/sqlite3.php
parent9572cc0cccf64f30140f47c2a620764778d0d018 (diff)
parentb3ca955fb598cb3afa4becd6eae84c620649e08d (diff)
downloadforums-489aba31c70c2b7ccafdd6941a4d2077afef0967.tar
forums-489aba31c70c2b7ccafdd6941a4d2077afef0967.tar.gz
forums-489aba31c70c2b7ccafdd6941a4d2077afef0967.tar.bz2
forums-489aba31c70c2b7ccafdd6941a4d2077afef0967.tar.xz
forums-489aba31c70c2b7ccafdd6941a4d2077afef0967.zip
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: [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/sqlite3.php')
-rw-r--r--phpBB/phpbb/db/driver/sqlite3.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php
index 5548105006..f5c2dd225b 100644
--- a/phpBB/phpbb/db/driver/sqlite3.php
+++ b/phpBB/phpbb/db/driver/sqlite3.php
@@ -265,11 +265,11 @@ class sqlite3 extends \phpbb\db\driver\driver
/**
* {@inheritDoc}
*
- * For SQLite an underscore is a not-known character...
+ * For SQLite an underscore is an unknown character.
*/
public 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);
@@ -280,6 +280,23 @@ class sqlite3 extends \phpbb\db\driver\driver
}
/**
+ * {@inheritDoc}
+ *
+ * For SQLite an underscore is an unknown character.
+ */
+ public 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
*
* @return array