Add hash_equals

This commit is contained in:
EdOverflow 2017-01-04 16:59:14 +01:00
parent f18e4f60e9
commit cf59eee98c
No known key found for this signature in database
GPG key ID: 39E31D6F1516A53E

View file

@ -142,7 +142,7 @@ class CredentialController extends ApiController {
);
if ($storedCredential->getUserId() !== $this->userId) {
if (!hash_equals($storedCredential->getUserId(), $this->userId)) {
$acl = $this->sharingService->getCredentialAclForUser($this->userId, $storedCredential->getGuid());
if ($acl->hasPermission(SharingACL::WRITE)) {
$credential['shared_key'] = $storedCredential->getSharedKey();
@ -219,7 +219,7 @@ class CredentialController extends ApiController {
'', array(),
$link, $target_user, Activity::TYPE_ITEM_ACTION);
}
if ($this->userId !== $storedCredential->getUserId()) {
if (!hash_equals($this->userId, $storedCredential->getUserId())) {
$this->activityService->add(
$activity, $params,
'', array(),