Author: Takuya Aramaki (takaram)
Committer: GitHub (web-flow)
Pusher: saundefined
Date: 2024-09-17T10:35:59+03:00

Commit: 
https://github.com/php/web-php/commit/c7425ed96a0f03bf175d8c715a656d9ce68c58af
Raw diff: 
https://github.com/php/web-php/commit/c7425ed96a0f03bf175d8c715a656d9ce68c58af.diff

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

See 7691b44067db646287064df92ad6bd10718ba9a6

Changed paths:
  M  include/langchooser.inc
  M  my.php


Diff:

diff --git a/include/langchooser.inc b/include/langchooser.inc
index f86ef8e83f..40790ad9d2 100644
--- a/include/langchooser.inc
+++ b/include/langchooser.inc
@@ -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)
@@ -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)
diff --git a/my.php b/my.php
index a2c4d7c931..dd68a9d3bd 100644
--- a/my.php
+++ b/my.php
@@ -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">
@@ -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"),
 

Reply via email to