diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-08-10 13:35:27 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-08-10 13:35:27 +0200 |
commit | b3ca955fb598cb3afa4becd6eae84c620649e08d (patch) | |
tree | 30ea814ef3092e7fca914aa52fb8c774848e0240 /phpBB/phpbb/db/driver/sqlite3.php | |
parent | 707568c49639930632b64099b0182ebc8deb1194 (diff) | |
parent | db0815f680d4ed9da845facb6e8e3975ac14621e (diff) | |
download | forums-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/sqlite3.php')
-rw-r--r-- | phpBB/phpbb/db/driver/sqlite3.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php index 0922229e0a..4e3e0d3329 100644 --- a/phpBB/phpbb/db/driver/sqlite3.php +++ b/phpBB/phpbb/db/driver/sqlite3.php @@ -260,11 +260,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); @@ -275,6 +275,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 |