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.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index fa580133..37f7ab60 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -48,6 +48,19 @@ class EntryController extends Controller
48 $form->handleRequest($request); 48 $form->handleRequest($request);
49 49
50 if ($form->isValid()) { 50 if ($form->isValid()) {
51 // check for existing entry, if it exists, redirect to it with a message
52 $existingEntry = $this->get('wallabag_core.entry_repository')
53 ->existByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
54
55 if (false !== $existingEntry) {
56 $this->get('session')->getFlashBag()->add(
57 'notice',
58 'Entry already saved on '.$existingEntry['createdAt']->format('d-m-Y')
59 );
60
61 return $this->redirect($this->generateUrl('view', array('id' => $existingEntry['id'])));
62 }
63
51 $this->updateEntry($entry); 64 $this->updateEntry($entry);
52 $this->get('session')->getFlashBag()->add( 65 $this->get('session')->getFlashBag()->add(
53 'notice', 66 'notice',