mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/12671] Possibility to use NOT LIKE expression
PHPBB3-12671
This commit is contained in:
parent
4c06467777
commit
635cde218c
2 changed files with 4 additions and 4 deletions
|
@ -294,14 +294,14 @@ class sqlite extends \phpbb\db\driver\driver
|
||||||
*/
|
*/
|
||||||
function sql_not_like_expression($expression)
|
function sql_not_like_expression($expression)
|
||||||
{
|
{
|
||||||
// Unlike LIKE, GLOB is case sensitive (unfortunatly). SQLite users need to live with it!
|
// Unlike NOT LIKE, NOT 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.
|
// 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(chr(0) . '_', chr(0) . '%'), array(chr(0) . '?', chr(0) . '*'), $expression);
|
||||||
|
|
||||||
$expression = str_replace(array('?', '*'), array("\?", "\*"), $expression);
|
$expression = str_replace(array('?', '*'), array("\?", "\*"), $expression);
|
||||||
$expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression);
|
$expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression);
|
||||||
|
|
||||||
return 'GLOB \'' . $this->sql_escape($expression) . '\'';
|
return 'NOT GLOB \'' . $this->sql_escape($expression) . '\'';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -281,14 +281,14 @@ class sqlite3 extends \phpbb\db\driver\driver
|
||||||
*/
|
*/
|
||||||
public function sql_not_like_expression($expression)
|
public function sql_not_like_expression($expression)
|
||||||
{
|
{
|
||||||
// Unlike LIKE, GLOB is case sensitive (unfortunatly). SQLite users need to live with it!
|
// Unlike NOT LIKE,NOT 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.
|
// 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(chr(0) . '_', chr(0) . '%'), array(chr(0) . '?', chr(0) . '*'), $expression);
|
||||||
|
|
||||||
$expression = str_replace(array('?', '*'), array("\?", "\*"), $expression);
|
$expression = str_replace(array('?', '*'), array("\?", "\*"), $expression);
|
||||||
$expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression);
|
$expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression);
|
||||||
|
|
||||||
return 'GLOB \'' . $this->sql_escape($expression) . '\'';
|
return 'NOT GLOB \'' . $this->sql_escape($expression) . '\'';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue