|
@@ -31,12 +31,14 @@ function setLoginCookie($cookie_length, $id, $password = '')
|
|
{
|
|
{
|
|
global $cookiename, $boardurl, $modSettings, $sourcedir;
|
|
global $cookiename, $boardurl, $modSettings, $sourcedir;
|
|
|
|
|
|
|
|
+ $id = (int) $id;
|
|
|
|
+
|
|
// If changing state force them to re-address some permission caching.
|
|
// If changing state force them to re-address some permission caching.
|
|
$_SESSION['mc']['time'] = 0;
|
|
$_SESSION['mc']['time'] = 0;
|
|
|
|
|
|
// The cookie may already exist, and have been set with different options.
|
|
// The cookie may already exist, and have been set with different options.
|
|
$cookie_state = (empty($modSettings['localCookies']) ? 0 : 1) | (empty($modSettings['globalCookies']) ? 0 : 2);
|
|
$cookie_state = (empty($modSettings['localCookies']) ? 0 : 1) | (empty($modSettings['globalCookies']) ? 0 : 2);
|
|
- if (isset($_COOKIE[$cookiename]) && preg_match('~^a:[34]:\{i:0;(i:\d{1,6}|s:[1-8]:"\d{1,8}");i:1;s:(0|40):"([a-fA-F0-9]{40})?";i:2;[id]:\d{1,14};(i:3;i:\d;)?\}$~', $_COOKIE[$cookiename]) === 1)
|
|
|
|
|
|
+ if (isset($_COOKIE[$cookiename]) && preg_match('~^a:[34]:\{i:0;i:\d{1,7};i:1;s:(0|40):"([a-fA-F0-9]{40})?";i:2;[id]:\d{1,14};(i:3;i:\d;)?\}$~', $_COOKIE[$cookiename]) === 1)
|
|
{
|
|
{
|
|
$array = @unserialize($_COOKIE[$cookiename]);
|
|
$array = @unserialize($_COOKIE[$cookiename]);
|
|
|
|
|