diff options
author | Robin Appelman <robin@icewind.nl> | 2021-08-17 14:50:13 +0300 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-08-17 14:51:45 +0300 |
commit | c48f9ffcdd83fb641a6433bc0543f3f90fbd08c4 (patch) | |
tree | 1a83ce9aa7e25207ba346d58b5c6aa96d30da9f7 /lib/private/Files/Cache | |
parent | 6f1c2ed50b036e5f910be48ed84e6e2a9a8e4a89 (diff) |
use case insensitive like when limiting search to jail
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Cache')
-rw-r--r-- | lib/private/Files/Cache/SearchBuilder.php | 6 | ||||
-rw-r--r-- | lib/private/Files/Cache/Wrapper/CacheJail.php | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/Files/Cache/SearchBuilder.php b/lib/private/Files/Cache/SearchBuilder.php index 7e1fbe08492..be38e5622bf 100644 --- a/lib/private/Files/Cache/SearchBuilder.php +++ b/lib/private/Files/Cache/SearchBuilder.php @@ -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'], diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php index 2dff76333ad..a01b130b487 100644 --- a/lib/private/Files/Cache/Wrapper/CacheJail.php +++ b/lib/private/Files/Cache/Wrapper/CacheJail.php @@ -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() . '/%'), ], ) ] |