mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-26 18:21:02 +00:00
Remove support for fallback in Redirect helper
This commit is contained in:
parent
ffec47bd88
commit
f4493f7472
4 changed files with 14 additions and 31 deletions
|
@ -104,7 +104,7 @@ class TagController extends AbstractController
|
|||
$this->entityManager->flush();
|
||||
}
|
||||
|
||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true);
|
||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), true);
|
||||
|
||||
return $this->redirect($redirectUrl);
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ class TagController extends AbstractController
|
|||
$form = $this->createForm(RenameTagType::class, new Tag());
|
||||
$form->handleRequest($request);
|
||||
|
||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true);
|
||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), true);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$newTag = new Tag();
|
||||
|
@ -257,7 +257,7 @@ class TagController extends AbstractController
|
|||
$this->entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirect($this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true));
|
||||
return $this->redirect($this->redirectHelper->to($request->getSession()->get('prevUrl'), true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -279,7 +279,7 @@ class TagController extends AbstractController
|
|||
$this->entityManager->remove($tag);
|
||||
$this->entityManager->flush();
|
||||
}
|
||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true);
|
||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), true);
|
||||
|
||||
return $this->redirect($redirectUrl);
|
||||
}
|
||||
|
|
|
@ -23,12 +23,11 @@ class Redirect
|
|||
|
||||
/**
|
||||
* @param string $url URL to redirect
|
||||
* @param string $fallback Fallback URL if $url is null
|
||||
* @param bool $ignoreActionMarkAsRead Ignore configured action when mark as read
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function to($url, $fallback = '', $ignoreActionMarkAsRead = false)
|
||||
public function to($url, $ignoreActionMarkAsRead = false)
|
||||
{
|
||||
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
||||
|
||||
|
@ -45,10 +44,6 @@ class Redirect
|
|||
return $url;
|
||||
}
|
||||
|
||||
if ('' === $fallback) {
|
||||
return $this->router->generate('homepage');
|
||||
}
|
||||
|
||||
return $fallback;
|
||||
return $this->router->generate('homepage');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue