Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove LAST_LANG cookie as it is not used anymore. #1072

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions include/langchooser.inc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ function language_choose_code()
// Specified for the request (GET/POST parameter)
if (!empty($_REQUEST['lang']) && is_string($_REQUEST['lang'])) {
$explicitly_specified = language_add(htmlspecialchars($_REQUEST['lang'], ENT_QUOTES, 'UTF-8'), $languages);

// Set the language in a cookie for a year
mirror_setcookie("LAST_LANG", $explicitly_specified, 60 * 60 * 24 * 365);
}

// Specified in a shortcut URL (eg. /en/echo or /pt_br/echo)
Expand Down Expand Up @@ -82,9 +79,6 @@ function language_choose_code()
if (empty($explicitly_specified)) {
$explicitly_specified = $flang;
}

// Set the language in a cookie for a year
mirror_setcookie("LAST_LANG", $flang, 60 * 60 * 24 * 365);
}

// Honor the users own language setting (if available)
Expand Down
8 changes: 2 additions & 6 deletions my.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@
If you use a shortcut or search for a function, the language used
is determined by checking for the following settings. The list is
in priority order, the first is the most important. Normally you don't
need to set your preferred language, as your last seen language is
always remembered, and is a good estimate of your preferred language
most of the time.
need to set your preferred language, as your browser's language preferences
are detected automatically using the Accept-Language header.
</p>

<div class="indent">
Expand All @@ -109,9 +108,6 @@
"<label for=\"form-my_lang\">Your preferred language</label>" =>
$langpref,

"Last seen language" =>
(isset($_COOKIE['LAST_LANG']) ? htmlentities($_COOKIE['LAST_LANG'], ENT_QUOTES | ENT_IGNORE, 'UTF-8') : "None"),

"Your Accept-Language browser setting" =>
(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? htmlentities($_SERVER['HTTP_ACCEPT_LANGUAGE'], ENT_QUOTES | ENT_IGNORE, 'UTF-8') : "None"),

Expand Down
Loading