1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/10521] Allow language switching by URL parameter

PHPBB3-10521
This commit is contained in:
Matt Friedman
2014-05-02 14:22:59 -07:00
parent 603c3b4629
commit 257ff46659
2 changed files with 14 additions and 5 deletions

View File

@@ -1045,8 +1045,9 @@ class session
* @param string $name Name of the cookie, will be automatically prefixed with the phpBB cookie name. track becomes [cookie_name]_track then.
* @param string $cookiedata The data to hold within the cookie
* @param int $cookietime The expiration time as UNIX timestamp. If 0 is provided, a session cookie is set.
* @param int $httponly Use HttpOnly. Defaults to true. Use false to make cookie accessible by client-side scripts.
*/
function set_cookie($name, $cookiedata, $cookietime)
function set_cookie($name, $cookiedata, $cookietime, $httponly = true)
{
global $config;
@@ -1054,7 +1055,7 @@ class session
$expire = gmdate('D, d-M-Y H:i:s \\G\\M\\T', $cookietime);
$domain = (!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain'];
header('Set-Cookie: ' . $name_data . (($cookietime) ? '; expires=' . $expire : '') . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . '; HttpOnly', false);
header('Set-Cookie: ' . $name_data . (($cookietime) ? '; expires=' . $expire : '') . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . ';' . (($httponly) ? ' HttpOnly' : ''), false);
}
/**