routeSQL : incorrect cookie used when search in a page and go in a chained page : the chained page use the cookie without need !

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2062 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-03-23 15:52:10 +00:00
parent eaf052d047
commit aa83ac633e

View File

@@ -615,12 +615,17 @@ class routeSQL
$this->chained->editright ($this->authHTML["email"], $chain) !== true) $this->chained->editright ($this->authHTML["email"], $chain) !== true)
$this->readwriteAllowed = false; $this->readwriteAllowed = false;
$this->url_prefix = str_replace ("{chain}", $chain, $this->url_prefix);
$cookiePrefix = rawurlencode ($this->url_prefix);
if (isset ($_COOKIE["$cookiePrefix-num"]))
$num = $_COOKIE["$cookiePrefix-num"];
if (isset ($_COOKIE["$cookiePrefix-page"]))
$page = $_COOKIE["$cookiePrefix-page"];
if (isset ($_COOKIE["$cookiePrefix-search"]))
$search = $_COOKIE["$cookiePrefix-search"];
// num is the number of elements displayed by page // num is the number of elements displayed by page
// page is the page to display // page is the page to display
// Allow the parameters to be sent in any order // Allow the parameters to be sent in any order
if (isset ($_COOKIE["num"])) $num = $_COOKIE["num"];
if (isset ($_COOKIE["page"])) $page = $_COOKIE["page"];
if (isset ($_COOKIE["search"])) $search = $_COOKIE["search"];
if ($p1 === "num") $num = $v1; if ($p1 === "num") $num = $v1;
if ($p2 === "num") $num = $v2; if ($p2 === "num") $num = $v2;
if ($p3 === "num") $num = $v3; if ($p3 === "num") $num = $v3;
@@ -636,10 +641,10 @@ class routeSQL
$page = intval ($page); $page = intval ($page);
$num = intval ($num); $num = intval ($num);
$search = rawurldecode ($search); $search = rawurldecode ($search);
setcookie ("page", $page, time()+3600*24*30, $this->path); setcookie ("$cookiePrefix-page", $page, time()+3600*24*30, $this->path);
setcookie ("num", $num, time()+3600*24*30, $this->path); setcookie ("$cookiePrefix-num", $num, time()+3600*24*30, $this->path);
setcookie ("search", $search, time()+3600*24*30, $this->path); setcookie ("$cookiePrefix-search", $search, time()+3600*24*30,
$this->url_prefix = str_replace ("{chain}", $chain, $this->url_prefix); $this->path);
//echo "PAGE=$page\n"; //echo "PAGE=$page\n";
//echo "NUM=$num\n"; //echo "NUM=$num\n";
//echo "SEARCH=$search\n"; //echo "SEARCH=$search\n";