mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 14:23:17 -04:00
use case insensitive like when limiting search to jail
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
6f1c2ed50b
commit
c48f9ffcdd
3 changed files with 6 additions and 3 deletions
|
|
@ -39,6 +39,7 @@ use OCP\Files\Search\ISearchOrder;
|
|||
class SearchBuilder {
|
||||
protected static $searchOperatorMap = [
|
||||
ISearchComparison::COMPARE_LIKE => 'iLike',
|
||||
ISearchComparison::COMPARE_LIKE_CASE_SENSITIVE => 'like',
|
||||
ISearchComparison::COMPARE_EQUAL => 'eq',
|
||||
ISearchComparison::COMPARE_GREATER_THAN => 'gt',
|
||||
ISearchComparison::COMPARE_GREATER_THAN_EQUAL => 'gte',
|
||||
|
|
@ -48,6 +49,7 @@ class SearchBuilder {
|
|||
|
||||
protected static $searchOperatorNegativeMap = [
|
||||
ISearchComparison::COMPARE_LIKE => 'notLike',
|
||||
ISearchComparison::COMPARE_LIKE_CASE_SENSITIVE => 'notLike',
|
||||
ISearchComparison::COMPARE_EQUAL => 'neq',
|
||||
ISearchComparison::COMPARE_GREATER_THAN => 'lte',
|
||||
ISearchComparison::COMPARE_GREATER_THAN_EQUAL => 'lt',
|
||||
|
|
@ -186,8 +188,8 @@ class SearchBuilder {
|
|||
$comparisons = [
|
||||
'mimetype' => ['eq', 'like'],
|
||||
'mtime' => ['eq', 'gt', 'lt', 'gte', 'lte'],
|
||||
'name' => ['eq', 'like'],
|
||||
'path' => ['eq', 'like'],
|
||||
'name' => ['eq', 'like', 'clike'],
|
||||
'path' => ['eq', 'like', 'clike'],
|
||||
'size' => ['eq', 'gt', 'lt', 'gte', 'lte'],
|
||||
'tagname' => ['eq', 'like'],
|
||||
'favorite' => ['eq'],
|
||||
|
|
|
|||
|
|
@ -313,7 +313,7 @@ class CacheJail extends CacheWrapper {
|
|||
new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_OR,
|
||||
[
|
||||
new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'path', $this->getGetUnjailedRoot()),
|
||||
new SearchComparison(ISearchComparison::COMPARE_LIKE, 'path', $this->getGetUnjailedRoot() . '/%'),
|
||||
new SearchComparison(ISearchComparison::COMPARE_LIKE_CASE_SENSITIVE, 'path', $this->getGetUnjailedRoot() . '/%'),
|
||||
],
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ interface ISearchComparison extends ISearchOperator {
|
|||
public const COMPARE_LESS_THAN = 'lt';
|
||||
public const COMPARE_LESS_THAN_EQUAL = 'lte';
|
||||
public const COMPARE_LIKE = 'like';
|
||||
public const COMPARE_LIKE_CASE_SENSITIVE = 'clike';
|
||||
|
||||
/**
|
||||
* Get the type of comparison, one of the ISearchComparison::COMPARE_* constants
|
||||
|
|
|
|||
Loading…
Reference in a new issue