diff options
author | Robin Appelman <robin@icewind.nl> | 2021-12-14 17:49:48 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-12-14 17:49:48 +0100 |
commit | f6024a895c2066f3b1c6231cabd9251834ebd6af (patch) | |
tree | 931278906fdd5c7f9881614f83c5090d667e1f48 /lib/private/Files | |
parent | 2f267e7fb7cb69f0948e2cf9e20b5beab653f5d8 (diff) | |
download | nextcloud-server-f6024a895c2066f3b1c6231cabd9251834ebd6af.tar.gz nextcloud-server-f6024a895c2066f3b1c6231cabd9251834ebd6af.zip |
also use case sensitive like when searching in a folder
this case was missed from https://github.com/nextcloud/server/pull/29080
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files')
-rw-r--r-- | lib/private/Files/Cache/QuerySearchHelper.php | 6 | ||||
-rw-r--r-- | lib/private/Files/Node/Folder.php | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/Files/Cache/QuerySearchHelper.php b/lib/private/Files/Cache/QuerySearchHelper.php index 16b15aa6b3b..48e916c52aa 100644 --- a/lib/private/Files/Cache/QuerySearchHelper.php +++ b/lib/private/Files/Cache/QuerySearchHelper.php @@ -39,6 +39,7 @@ use OCP\Files\Search\ISearchOrder; class QuerySearchHelper { 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 QuerySearchHelper { 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', @@ -187,8 +189,8 @@ class QuerySearchHelper { $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/Node/Folder.php b/lib/private/Files/Node/Folder.php index 24ee7bbfb8a..98a1a7d14cd 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -263,7 +263,7 @@ class Folder extends Node implements \OCP\Files\Folder { $subQueryLimit = $query->getLimit() > 0 ? $query->getLimit() + $query->getOffset() : 0; $rootQuery = new SearchQuery( new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_AND, [ - new SearchComparison(ISearchComparison::COMPARE_LIKE, 'path', $internalPath . '%'), + new SearchComparison(ISearchComparison::COMPARE_LIKE_CASE_SENSITIVE, 'path', $internalPath . '%'), $query->getSearchOperation(), ] ), |