]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/EntryController.php
Replaced favorite word/icon with star one
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / EntryController.php
index 33b5e2ad03905232dad0df1f0e130275e30853c7..775dfccd946398f076cc95f0ab1664c240aa5a74 100644 (file)
@@ -357,7 +357,7 @@ class EntryController extends Controller
     }
 
     /**
-     * Changes favorite status for an entry.
+     * Changes star status for an entry.
      *
      * @param Request $request
      * @param Entry   $entry
@@ -406,7 +406,7 @@ class EntryController extends Controller
         $url = $this->generateUrl(
             'view',
             ['id' => $entry->getId()],
-            UrlGeneratorInterface::ABSOLUTE_URL
+            UrlGeneratorInterface::ABSOLUTE_PATH
         );
 
         $em = $this->getDoctrine()->getManager();
@@ -418,8 +418,9 @@ class EntryController extends Controller
             'flashes.entry.notice.entry_deleted'
         );
 
-        // don't redirect user to the deleted entry
-        $to = ($url !== $request->headers->get('referer') ? $request->headers->get('referer') : null);
+        // don't redirect user to the deleted entry (check that the referer doesn't end with the same url)
+        $referer = $request->headers->get('referer');
+        $to = (1 !== preg_match('#'.$url.'$#i', $referer) ? $referer : null);
 
         $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($to);