forked from wallabag/wallabag
Fix hazardous bug with Postgres
Instead of retrieving a random annotation, sort them to be sure they are all the same no matter the database used
This commit is contained in:
@ -101,6 +101,7 @@ class AnnotationRepository extends EntityRepository
|
||||
return $this->createQueryBuilder('a')
|
||||
->leftJoin('a.user', 'u')
|
||||
->where('u.username = :username')->setParameter('username', $username)
|
||||
->orderBy('a.id', 'DESC')
|
||||
->setMaxResults(1)
|
||||
->getQuery()
|
||||
->getSingleResult();
|
||||
|
||||
Reference in New Issue
Block a user