Changeset 6644 for sites/trunk/wordpress.org/public_html/wp-content/plugins/locale-detection/class-detector.php
- Timestamp:
- 02/15/2018 11:01:34 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/locale-detection/class-detector.php
r6640 r6644 44 44 $this->active_locales = $this->get_active_locales(); 45 45 46 if ( ! empty( $_COOKIE[ 'wporg_locale' ] ) ) { 46 if ( ! empty( $_GET['locale'] ) ) { 47 $get_locale = $this->sanitize_locale( $_GET['locale'] ); 48 49 $this->locale = $this->check_variants( $get_locale ) ?: $this->locale; 50 } elseif ( ! empty( $_COOKIE['wporg_locale'] ) ) { 47 51 $locale = $this->sanitize_locale( $_COOKIE['wporg_locale'] ); 48 52 49 53 if ( in_array( $locale, $this->active_locales, true ) ) { 50 54 $this->locale = $locale; 51 return;52 55 } 53 }54 55 if ( isset( $_GET['locale'] ) ) {56 $get_locale = $this->sanitize_locale( $_GET['locale'] );57 58 $this->locale = $this->check_variants( $get_locale ) ?: $this->locale;59 56 } else { 60 57 $this->locale = $this->guess_locale() ?: $this->locale; 58 setcookie( 'wporg_locale', $this->locale, time() + YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN, is_ssl() ); 61 59 } 62 63 setcookie( 'wporg_locale', $this->locale, time() + YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN, is_ssl() );64 60 } 65 61
Note: See TracChangeset
for help on using the changeset viewer.