From ef6eb74415f4835df4b105d1c5ff7491bc50d5b4 Mon Sep 17 00:00:00 2001 From: brantje Date: Sat, 15 Oct 2016 22:37:23 +0200 Subject: [PATCH] Fix count --- lib/Db/CredentialMapper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Db/CredentialMapper.php b/lib/Db/CredentialMapper.php index 4b3dd24c..694db591 100644 --- a/lib/Db/CredentialMapper.php +++ b/lib/Db/CredentialMapper.php @@ -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; }