X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FController%2FEntryController.php;h=ccdf940669bde3d5aa00073256c5607e8ba1805c;hb=389d55f86b962a448d7a5052a5c0cf438d161c41;hp=33b5e2ad03905232dad0df1f0e130275e30853c7;hpb=15840670287d9c3683e7d02984f61deab825e08a;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 33b5e2ad..ccdf9406 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -357,7 +357,7 @@ class EntryController extends Controller } /** - * Changes favorite status for an entry. + * Changes starred 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);