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:
19
routeSQL.php
19
routeSQL.php
@@ -615,12 +615,17 @@ class routeSQL
|
||||
$this->chained->editright ($this->authHTML["email"], $chain) !== true)
|
||||
$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
|
||||
// page is the page to display
|
||||
// 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 ($p2 === "num") $num = $v2;
|
||||
if ($p3 === "num") $num = $v3;
|
||||
@@ -636,10 +641,10 @@ class routeSQL
|
||||
$page = intval ($page);
|
||||
$num = intval ($num);
|
||||
$search = rawurldecode ($search);
|
||||
setcookie ("page", $page, time()+3600*24*30, $this->path);
|
||||
setcookie ("num", $num, time()+3600*24*30, $this->path);
|
||||
setcookie ("search", $search, time()+3600*24*30, $this->path);
|
||||
$this->url_prefix = str_replace ("{chain}", $chain, $this->url_prefix);
|
||||
setcookie ("$cookiePrefix-page", $page, time()+3600*24*30, $this->path);
|
||||
setcookie ("$cookiePrefix-num", $num, time()+3600*24*30, $this->path);
|
||||
setcookie ("$cookiePrefix-search", $search, time()+3600*24*30,
|
||||
$this->path);
|
||||
//echo "PAGE=$page\n";
|
||||
//echo "NUM=$num\n";
|
||||
//echo "SEARCH=$search\n";
|
||||
|
||||
Reference in New Issue
Block a user