🚴.
[pin4sha_cgi.git] / patches / sebsauvage / Shaarli / archive / master / 001.patch
blob514d6c810a7d503e9b1e656dd0bf42bb2bd337ec
1 diff --git a/index.php b/index.php
2 index c102e42..3271e53 100644
3 --- a/index.php
4 +++ b/index.php
5 @@ -43,7 +43,7 @@ define('WEB_PATH', substr($_SERVER["REQUEST_URI"], 0, 1+strrpos($_SERVER["REQUES
6 // Force cookie path (but do not change lifetime)
7 $cookie=session_get_cookie_params();
8 $cookiedir = ''; if(dirname($_SERVER['SCRIPT_NAME'])!='/') $cookiedir=dirname($_SERVER["SCRIPT_NAME"]).'/';
9 -session_set_cookie_params($cookie['lifetime'],$cookiedir,$_SERVER['HTTP_HOST']); // Set default cookie expiration and path.
10 +session_set_cookie_params($cookie['lifetime'],$cookiedir,$_SERVER['SERVER_NAME']); // Set default cookie expiration and path.
12 // Set session parameters on server side.
13 define('INACTIVITY_TIMEOUT',3600); // (in seconds). If the user does not access any page within this time, his/her session is considered expired.
14 @@ -610,6 +610,7 @@ function getToken()
16 $rnd = sha1(uniqid('',true).'_'.mt_rand().$GLOBALS['salt']); // We generate a random string.
17 $_SESSION['tokens'][$rnd]=1; // Store it on the server side.
18 + logm("getToken(); // token: ".$rnd);
19 return $rnd;
22 @@ -617,6 +618,7 @@ function getToken()
23 // true=token is ok.
24 function tokenOk($token)
26 + logm("tokenOk('".$token."'); // _SESSION['tokens']=[".implode(", ", array_keys($_SESSION['tokens']))."]");
27 if (isset($_SESSION['tokens'][$token]))
29 unset($_SESSION['tokens'][$token]); // Token is used: destroy it.
30 @@ -1355,6 +1357,7 @@ function renderPage()
31 exit;
34 + logm("QUERY_STRING: '".$_SERVER["QUERY_STRING"]."'");
35 // -------- User wants to change his/her password.
36 if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=changepasswd'))