Skip to content

Commit

Permalink
Merge pull request #299 from immerda/preventUserEnumeration
Browse files Browse the repository at this point in the history
honor user enumeration prevention of the share api
  • Loading branch information
ArtificialOwl authored Jun 24, 2019
2 parents 7b87aae + 3f8610d commit 0b7ef01
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/Controller/MembersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
namespace OCA\Circles\Controller;

use OCA\Circles\Model\Member;
use OCA\Circles\Model\SearchResult;
use OCA\Circles\Service\MiscService;
use OCP\AppFramework\Http\DataResponse;

Expand Down Expand Up @@ -173,6 +174,16 @@ public function searchGlobal($search) {
);
}

if ($this->configService->getAppValue('shareapi_allow_share_dialog_user_enumeration') !== 'yes') {
$result = array_filter(
$result,
function($data, $k) use ($search) {
/** @var SearchResult $data */
return $data->getIdent() === $search;
}, ARRAY_FILTER_USE_BOTH
);
}

return $this->success(['search' => $search, 'result' => $result]);
}

Expand Down

0 comments on commit 0b7ef01

Please sign in to comment.