Plugin Directory

Changeset 1073921


Ignore:
Timestamp:
01/23/2015 07:36:44 AM (11 years ago)
Author:
chsxf
Message:

[Working draft] Fixed bugs

  • Reintroduced secure cookies option
  • Reintroduced feature to disable cookies on client-side
  • Fixed a bug with cookie name
File:
1 edited

Legend:

Unmodified
Added
Removed
  • mqtranslate/trunk/mqtranslate_core.php

    r1073919 r1073921  
    117117function qtrans_set_language_cookie($lang, $cookie_path)
    118118{
     119    global $q_config;
     120   
    119121    if (defined('WP_ADMIN')) {
    120122        $cookie_name = QT_COOKIE_NAME_ADMIN;
    121123        $cookie_path = trailingslashit($cookie_path).'wp-admin';
     124        $cookie_secure = false;
    122125    }
    123126    else {
     127        if (!empty($q_config['disable_client_cookies']))
     128            return;
     129       
    124130        $cookie_name = QT_COOKIE_NAME_FRONT;
    125131        if (strlen($cookie_path) > 1)
    126132            $cookie_path = untrailingslashit($cookie_path);
    127     }
    128     setcookie(QT_COOKIE_NAME, $lang, time()+86400*365, $cookie_path);
     133        $cookie_secure = !empty($q_config['use_secure_cookie']);
     134    }
     135    setcookie($cookie_name, $lang, time()+86400*365, $cookie_path, NULL, $cookie_secure);
    129136}
    130137
Note: See TracChangeset for help on using the changeset viewer.