mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-17 20:35:27 +00:00
Delegate findByUrlAndUserId to findByHashedUrlAndUserId
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
This commit is contained in:
parent
31e276fc16
commit
d5744bf0df
1 changed files with 3 additions and 11 deletions
|
@ -348,17 +348,9 @@ class EntryRepository extends EntityRepository
|
|||
*/
|
||||
public function findByUrlAndUserId($url, $userId)
|
||||
{
|
||||
$res = $this->createQueryBuilder('e')
|
||||
->where('e.url = :url')->setParameter('url', urldecode($url))
|
||||
->andWhere('e.user = :user_id')->setParameter('user_id', $userId)
|
||||
->getQuery()
|
||||
->getResult();
|
||||
|
||||
if (\count($res)) {
|
||||
return current($res);
|
||||
}
|
||||
|
||||
return false;
|
||||
return $this->findByHashedUrlAndUserId(
|
||||
hash('sha1', $url), // XXX: the hash logic would better be in a separate util to avoid duplication with GenerateUrlHashesCommand::generateHashedUrls
|
||||
$userId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue