From 8af89d802667876bc6ef36131a3d40a9a529c1f7 Mon Sep 17 00:00:00 2001 From: guanxiying Date: Tue, 26 Nov 2019 16:58:14 +0800 Subject: [PATCH] * set httponly false for cookie written by js. --- module/bug/control.php | 6 +++--- module/product/control.php | 4 ++-- module/project/control.php | 6 +++--- module/story/control.php | 2 +- module/task/control.php | 2 +- module/testcase/control.php | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index bd0ae63cb9..bcfb35498b 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -83,9 +83,9 @@ class bug extends control if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch) { $_COOKIE['bugModule'] = 0; - setcookie('bugModule', 0, 0, $this->config->webRoot, '', false, true); + setcookie('bugModule', 0, 0, $this->config->webRoot, '', false, false); } - if($browseType == 'bymodule') setcookie('bugModule', (int)$param, 0, $this->config->webRoot, '', false, true); + if($browseType == 'bymodule') setcookie('bugModule', (int)$param, 0, $this->config->webRoot, '', false, false); if($browseType != 'bymodule') $this->session->set('bugBrowseType', $browseType); $moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->bugModule ? $this->cookie->bugModule : 0)); @@ -299,7 +299,7 @@ class bug extends control if(defined('RUN_MODE') && RUN_MODE == 'api') $this->send(array('status' => 'success', 'data' => $bugID)); - setcookie('bugModule', (int)$this->post->module, 0, $this->config->webRoot, '', false, true); + setcookie('bugModule', (int)$this->post->module, 0, $this->config->webRoot, '', false, false); $location = $this->createLink('bug', 'browse', "productID={$this->post->product}&branch=$branch&browseType=unclosed¶m=0&orderBy=id_desc"); if($this->app->getViewType() == 'xhtml') $location = $this->createLink('bug', 'view', "bugID=$bugID"); $response['locate'] = $location; diff --git a/module/product/control.php b/module/product/control.php index d870ab12ac..5aad6bfe91 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -121,9 +121,9 @@ class product extends control if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch) { $_COOKIE['storyModule'] = 0; - setcookie('storyModule', 0, 0, $this->config->webRoot, '', false, true); + setcookie('storyModule', 0, 0, $this->config->webRoot, '', false, false); } - if($browseType == 'bymodule') setcookie('storyModule', (int)$param, 0, $this->config->webRoot, '', false, true); + if($browseType == 'bymodule') setcookie('storyModule', (int)$param, 0, $this->config->webRoot, '', false, false); if($browseType != 'bymodule') $this->session->set('storyBrowseType', $browseType); $moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->storyModule ? $this->cookie->storyModule : 0)); diff --git a/module/project/control.php b/module/project/control.php index 99f87043c2..38c0775700 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -131,17 +131,17 @@ class project extends control if($this->cookie->preProjectID != $projectID) { $_COOKIE['moduleBrowseParam'] = $_COOKIE['productBrowseParam'] = 0; - setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot, '', false, true); + setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot, '', false, false); setcookie('productBrowseParam', 0, 0, $this->config->webRoot, '', false, true); } if($browseType == 'bymodule') { - setcookie('moduleBrowseParam', (int)$param, 0, $this->config->webRoot, '', false, true); + setcookie('moduleBrowseParam', (int)$param, 0, $this->config->webRoot, '', false, false); setcookie('productBrowseParam', 0, 0, $this->config->webRoot, '', false, true); } elseif($browseType == 'byproduct') { - setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot, '', false, true); + setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot, '', false, false); setcookie('productBrowseParam', (int)$param, 0, $this->config->webRoot, '', false, true); } else diff --git a/module/story/control.php b/module/story/control.php index da76e16c6d..56af4a7d9c 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -126,7 +126,7 @@ class story extends control $response['locate'] = $this->createLink('project', 'story', "projectID=$projectID&orderBy=&browseType=byModule&moduleID=$moduleID"); if($projectID == 0) { - setcookie('storyModule', (int)$moduleID, 0, $this->config->webRoot, '', false, true); + setcookie('storyModule', (int)$moduleID, 0, $this->config->webRoot, '', false, false); $productID = $this->post->product ? $this->post->product : $productID; $branchID = $this->post->branch ? $this->post->branch : $branch; $response['locate'] = $this->createLink('product', 'browse', "productID=$productID&branch=$branchID&browseType=unclosed¶m=0&orderBy=id_desc"); diff --git a/module/task/control.php b/module/task/control.php index 02d238ed53..5bccbd8e92 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -155,7 +155,7 @@ class task extends control } elseif($this->post->after == 'toTaskList') { - setcookie('moduleBrowseParam', (int)$this->post->module, 0, $this->config->webRoot, '', false, true); + setcookie('moduleBrowseParam', (int)$this->post->module, 0, $this->config->webRoot, '', false, false); $taskLink = $this->createLink('project', 'task', "projectID=$projectID&status=unclosed¶m=0&orderBy=id_desc"); $response['locate'] = $taskLink; $this->send($response); diff --git a/module/testcase/control.php b/module/testcase/control.php index e20b4d44ee..d955ce3440 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -69,9 +69,9 @@ class testcase extends control if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch) { $_COOKIE['caseModule'] = 0; - setcookie('caseModule', 0, 0, $this->config->webRoot, '', false, true); + setcookie('caseModule', 0, 0, $this->config->webRoot, '', false, false); } - if($browseType == 'bymodule') setcookie('caseModule', (int)$param, 0, $this->config->webRoot, '', false, true); + if($browseType == 'bymodule') setcookie('caseModule', (int)$param, 0, $this->config->webRoot, '', false, false); if($browseType == 'bysuite') setcookie('caseSuite', (int)$param, 0, $this->config->webRoot, '', false, true); if($browseType != 'bymodule') $this->session->set('caseBrowseType', $browseType); @@ -243,7 +243,7 @@ class testcase extends control /* If link from no head then reload. */ if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true)); - setcookie('caseModule', (int)$this->post->module, 0, $this->config->webRoot, '', false, true); + setcookie('caseModule', (int)$this->post->module, 0, $this->config->webRoot, '', false, false); $response['locate'] = $this->createLink('testcase', 'browse', "productID={$this->post->product}&branch={$this->post->branch}&browseType=all¶m=0&orderBy=id_desc"); $this->send($response); }