Update EntryController.php

This commit is contained in:
Michael Ciociola 2023-08-06 20:19:49 +00:00 committed by GitHub
parent ced2ea4015
commit 9729db75de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,7 +128,7 @@ class EntryController extends AbstractController
$this->entityManager->flush(); $this->entityManager->flush();
} }
$redirectUrl = $this->redirectHelper->to($request->headers->get('prevUrl')); $redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'));
return $this->redirect($redirectUrl); return $this->redirect($redirectUrl);
} }
@ -453,7 +453,7 @@ class EntryController extends AbstractController
); );
$redirectUrl = $this->redirectHelper->to($request->headers->get('prevUrl')); $redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'));
return $this->redirect($redirectUrl); return $this->redirect($redirectUrl);
} }
@ -483,7 +483,7 @@ class EntryController extends AbstractController
$message $message
); );
$redirectUrl = $this->redirectHelper->to($request->headers->get('prevUrl')); $redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'));
return $this->redirect($redirectUrl); return $this->redirect($redirectUrl);
} }
@ -520,7 +520,7 @@ class EntryController extends AbstractController
// don't redirect user to the deleted entry (check that the referer doesn't end with the same url) // don't redirect user to the deleted entry (check that the referer doesn't end with the same url)
$prev = $request->headers->get('prevUrl'); $prev = $request->getSession()->get('prevUrl');
$to = (1 !== preg_match('#' . $url . '$#i', $prev) ? $prev : null); $to = (1 !== preg_match('#' . $url . '$#i', $prev) ? $prev : null);
$redirectUrl = $this->redirectHelper->to($to); $redirectUrl = $this->redirectHelper->to($to);