mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
minor
This commit is contained in:
parent
1aeb5618bb
commit
e50e729019
1 changed files with 22 additions and 29 deletions
|
@ -1,16 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* Description of i18nActions
|
|
||||||
*
|
|
||||||
* @author Nacib Neme
|
|
||||||
*/
|
|
||||||
|
|
||||||
class i18nActions extends Actions
|
class i18nActions extends Actions
|
||||||
{
|
{
|
||||||
public static function setCulture()
|
public static function setCulture()
|
||||||
{
|
{
|
||||||
$culture = $_POST['culture'] ?? null;
|
$culture = Request::getPostParam('culture');
|
||||||
|
|
||||||
// Validate
|
// Validate
|
||||||
if ($culture && !in_array($culture, i18n::getAllCultures()))
|
if ($culture && !in_array($culture, i18n::getAllCultures()))
|
||||||
|
@ -22,7 +16,6 @@ class i18nActions extends Actions
|
||||||
{
|
{
|
||||||
Session::set(Session::KEY_USER_CULTURE, $culture);
|
Session::set(Session::KEY_USER_CULTURE, $culture);
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Session::unsetKey(Session::KEY_USER_CULTURE);
|
Session::unsetKey(Session::KEY_USER_CULTURE);
|
||||||
|
@ -31,6 +24,6 @@ class i18nActions extends Actions
|
||||||
//if session changes update domain
|
//if session changes update domain
|
||||||
//english language = www
|
//english language = www
|
||||||
|
|
||||||
return Controller::redirect($_SERVER['HTTP_REFERER'] ?: '/');
|
return Controller::redirect(Request::getHttpHeader('Referer', '/'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue