Making WordPress.org

Changeset 6674


Ignore:
Timestamp:
02/17/2018 11:52:49 AM (7 years ago)
Author:
ocean90
Message:

Locale Detection: Always store the detected locale in a cookie.

Ensures that the same locale is also used during POST requests.

See #1673.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/locale-detection/class-detector.php

    r6673 r6674  
    4848
    4949    /**
    50      * Sets the locale property based on the following parameters:
     50     * Sets the locale property and cookie based on the following parameters:
    5151     *  1. $_GET['locale']
    5252     *  2. $_COOKIE['wporg_locale']
     
    6666        } else {
    6767            $this->locale = $this->guess_locale() ?: $this->locale;
     68        }
     69
     70        if ( empty( $_COOKIE['wporg_locale'] ) || $this->locale !== $_COOKIE['wporg_locale'] ) {
    6871            setcookie( 'wporg_locale', $this->locale, time() + YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN, is_ssl() );
    6972        }
Note: See TracChangeset for help on using the changeset viewer.