Fix count

This commit is contained in:
brantje 2016-10-15 22:37:23 +02:00
parent 3524cded0d
commit ef6eb74415
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F

View file

@ -41,7 +41,7 @@ class CredentialMapper extends Mapper {
$sql = 'SELECT * FROM `*PREFIX*passman_credentials` ' .
'WHERE `user_id` = ? and vault_id = ? AND shared_key is NULL LIMIT 20';
$entities = $this->findEntities($sql, [$user_id, $vault_id]);
$count = count($entities);
$count = count($entities)-1;
$entities = array_splice($entities, rand(0, $count), 1);
return $entities;
}