aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/front/controller/visitor/TagController.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-06-13 13:08:01 +0200
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commit9c75f877935fa6adec951a4d8d32b328aaab314f (patch)
tree1cdd09ddfc00c6cebb92bb2b90381a06fd31246d /application/front/controller/visitor/TagController.php
parent818b3193ffabec57501e3bdfa997206e3c0671ef (diff)
downloadShaarli-9c75f877935fa6adec951a4d8d32b328aaab314f.tar.gz
Shaarli-9c75f877935fa6adec951a4d8d32b328aaab314f.tar.zst
Shaarli-9c75f877935fa6adec951a4d8d32b328aaab314f.zip
Use multi-level routes for existing controllers instead of 1 level everywhere
Also prefix most admin routes with /admin/
Diffstat (limited to 'application/front/controller/visitor/TagController.php')
-rw-r--r--application/front/controller/visitor/TagController.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/application/front/controller/visitor/TagController.php b/application/front/controller/visitor/TagController.php
index a0bc1d1b..c176f43f 100644
--- a/application/front/controller/visitor/TagController.php
+++ b/application/front/controller/visitor/TagController.php
@@ -11,6 +11,8 @@ use Slim\Http\Response;
11 * Class TagController 11 * Class TagController
12 * 12 *
13 * Slim controller handle tags. 13 * Slim controller handle tags.
14 *
15 * TODO: check redirections with new helper
14 */ 16 */
15class TagController extends ShaarliVisitorController 17class TagController extends ShaarliVisitorController
16{ 18{
@@ -27,10 +29,10 @@ class TagController extends ShaarliVisitorController
27 // In case browser does not send HTTP_REFERER, we search a single tag 29 // In case browser does not send HTTP_REFERER, we search a single tag
28 if (null === $referer) { 30 if (null === $referer) {
29 if (null !== $newTag) { 31 if (null !== $newTag) {
30 return $response->withRedirect('./?searchtags='. urlencode($newTag)); 32 return $this->redirect($response, '/?searchtags='. urlencode($newTag));
31 } 33 }
32 34
33 return $response->withRedirect('./'); 35 return $this->redirect($response, '/');
34 } 36 }
35 37
36 $currentUrl = parse_url($referer); 38 $currentUrl = parse_url($referer);
@@ -81,7 +83,7 @@ class TagController extends ShaarliVisitorController
81 83
82 // If the referrer is not provided, we can update the search, so we failback on the bookmark list 84 // If the referrer is not provided, we can update the search, so we failback on the bookmark list
83 if (empty($referer)) { 85 if (empty($referer)) {
84 return $response->withRedirect('./'); 86 return $this->redirect($response, '/');
85 } 87 }
86 88
87 $tagToRemove = $args['tag'] ?? null; 89 $tagToRemove = $args['tag'] ?? null;