aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/EntryController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/EntryController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index de2eedcb..9097810c 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -51,15 +51,15 @@ class EntryController extends Controller
51 if ($form->isValid()) { 51 if ($form->isValid()) {
52 $existingEntry = $em 52 $existingEntry = $em
53 ->getRepository('WallabagCoreBundle:Entry') 53 ->getRepository('WallabagCoreBundle:Entry')
54 ->findOneByUrl($entry->getUrl()); 54 ->findOneByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
55 55
56 if (!is_null($existingEntry)) { 56 if (count($existingEntry) > 0) {
57 $this->get('session')->getFlashBag()->add( 57 $this->get('session')->getFlashBag()->add(
58 'notice', 58 'notice',
59 'Entry already saved on '.$existingEntry->getCreatedAt()->format('d-m-Y') 59 'Entry already saved on '.$existingEntry[0]->getCreatedAt()->format('d-m-Y')
60 ); 60 );
61 61
62 return $this->redirect($this->generateUrl('view', array('id' => $existingEntry->getId()))); 62 return $this->redirect($this->generateUrl('view', array('id' => $existingEntry[0]->getId())));
63 } 63 }
64 64
65 $this->updateEntry($entry); 65 $this->updateEntry($entry);