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/sqlite.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/sqlite.php')
-rw-r--r-- | phpBB/phpbb/db/driver/sqlite.php | 19 |
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 */ |