more privacy

This commit is contained in:
Shish 2020-02-01 23:30:19 +00:00
parent 0bcbcb679e
commit b6656e8141

View file

@ -49,7 +49,7 @@ class BasePage
/** @var string */ /** @var string */
public $mode = PageMode::PAGE; public $mode = PageMode::PAGE;
/** @var string */ /** @var string */
public $type = "text/html; charset=utf-8"; private $type = "text/html; charset=utf-8";
/** /**
* Set what this page should do; "page", "data", or "redirect". * Set what this page should do; "page", "data", or "redirect".
@ -80,11 +80,11 @@ class BasePage
/** @var string; public only for unit test */ /** @var string; public only for unit test */
public $data = ""; public $data = "";
/** @var string; */ /** @var string */
public $file = null; private $file = null;
/** @var string; public only for unit test */ /** @var string */
public $filename = null; private $filename = null;
private $disposition = null; private $disposition = null;
@ -237,14 +237,6 @@ class BasePage
return $data; return $data;
} }
/**
* Removes all currently set HTML headers (Be careful..).
*/
public function delete_all_html_headers(): void
{
$this->html_headers = [];
}
/** /**
* Add a Block of data to the page. * Add a Block of data to the page.
*/ */
@ -274,8 +266,6 @@ class BasePage
*/ */
public function display(): void public function display(): void
{ {
global $user;
header("HTTP/1.0 {$this->code} Shimmie"); header("HTTP/1.0 {$this->code} Shimmie");
header("Content-type: " . $this->type); header("Content-type: " . $this->type);
header("X-Powered-By: Shimmie-" . VERSION); header("X-Powered-By: Shimmie-" . VERSION);
@ -294,6 +284,7 @@ class BasePage
switch ($this->mode) { switch ($this->mode) {
case PageMode::PAGE: case PageMode::PAGE:
if (CACHE_HTTP) { if (CACHE_HTTP) {
global $user;
header("Vary: Cookie, Accept-Encoding"); header("Vary: Cookie, Accept-Encoding");
if ($user->is_anonymous() && $_SERVER["REQUEST_METHOD"] == "GET") { if ($user->is_anonymous() && $_SERVER["REQUEST_METHOD"] == "GET") {
header("Cache-control: public, max-age=600"); header("Cache-control: public, max-age=600");