From 5539860a0a3ec986ae3ae6a2cff48777a9dd9af4 Mon Sep 17 00:00:00 2001 From: loblao <12ksit@gmail.com> Date: Mon, 5 Sep 2016 10:26:18 -0300 Subject: [PATCH] i18n: Send a POST request instead of an AJAX request --- controller/Controller.class.php | 2 +- controller/action/i18nActions.class.php | 2 +- view/template/nav/_globalItems.php | 10 ++++++---- web/js/global.js | 5 +---- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/controller/Controller.class.php b/controller/Controller.class.php index 7872cf22..0db0148d 100644 --- a/controller/Controller.class.php +++ b/controller/Controller.class.php @@ -94,7 +94,7 @@ class Controller $router->any('/list/subscribe', 'MailActions::executeSubscribe'); $router->get('/list/confirm/{hash}', 'MailActions::executeConfirm'); - $router->post('/language', 'i18nActions::setCulture'); + $router->post('/set-culture', 'i18nActions::setCulture'); $permanentRedirects = [ '/lbry-osx-latest.dmg' => '/get', diff --git a/controller/action/i18nActions.class.php b/controller/action/i18nActions.class.php index f7fc492a..a78c5f55 100644 --- a/controller/action/i18nActions.class.php +++ b/controller/action/i18nActions.class.php @@ -28,6 +28,6 @@ class i18nActions extends Actions Session::unsetKey(Session::KEY_USER_CULTURE); } - return [null, null]; + return Controller::redirect('/'); } } diff --git a/view/template/nav/_globalItems.php b/view/template/nav/_globalItems.php index 0a0ef25d..0b340c33 100644 --- a/view/template/nav/_globalItems.php +++ b/view/template/nav/_globalItems.php @@ -23,10 +23,12 @@ GitHub