summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-09-24 09:43:37 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-24 09:43:37 +0200
commit8c0cf07d2f5a1b8f5402bd01b9503663d775e119 (patch)
treef620f15a85137dfe2d420ab51219cf01c2836eac /core
parent1191dda0d88c25cbc02de7752e7d9ef81b9f8b9f (diff)
parent19e7a08cbffbf4f9736646e9b3c90b4410642005 (diff)
downloadnextcloud-server-8c0cf07d2f5a1b8f5402bd01b9503663d775e119.tar.gz
nextcloud-server-8c0cf07d2f5a1b8f5402bd01b9503663d775e119.zip
Merge pull request #18352 from owncloud/ocs_api_sharees_autocomplete_blocker
Implement the autocomplete blocker from #18341 into the OCS endpoint
Diffstat (limited to 'core')
-rw-r--r--core/ajax/share.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php
index 69b84564ab1..4546217def3 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -379,6 +379,16 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
}
}
+ $sharingAutocompletion = \OC::$server->getConfig()
+ ->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes');
+
+ if ($sharingAutocompletion !== 'yes') {
+ $searchTerm = strtolower($_GET['search']);
+ $shareWith = array_filter($shareWith, function($user) use ($searchTerm) {
+ return strtolower($user['label']) === $searchTerm
+ || strtolower($user['value']['shareWith']) === $searchTerm;
+ });
+ }
$sorter = new \OC\Share\SearchResultSorter((string)$_GET['search'],
'label',