1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/12671] Possibility to use NOT LIKE expression

PHPBB3-12671
This commit is contained in:
Geolim4
2014-08-08 15:06:12 +02:00
parent f6da266109
commit 6b60153ab4
11 changed files with 137 additions and 0 deletions

View File

@@ -287,6 +287,23 @@ class sqlite extends \phpbb\db\driver\driver
return 'GLOB \'' . $this->sql_escape($expression) . '\'';
}
/**
* {@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