Add data filtering for HTTP_REFERER and HTTP_USER_AGENT

This commit is contained in:
Visman 2020-11-10 23:32:54 +07:00
parent 0aea6cee01
commit 635f0ee4df
3 changed files with 6 additions and 3 deletions

View file

@ -64,7 +64,7 @@ class Auth extends Page
$this->fIswev = $v->getErrors();
}
$ref = $_SERVER['HTTP_REFERER'] ?? '';
$ref = $this->c->Secury->replInvalidChars($_SERVER['HTTP_REFERER'] ?? '');
$this->fIndex = 'login';
$this->nameTpl = 'login';

View file

@ -46,7 +46,10 @@ class Email extends Page
}
$data = [
'redirect' => $this->c->Router->validate($_SERVER['HTTP_REFERER'] ?? '', 'Index'),
'redirect' => $this->c->Router->validate(
$this->c->Secury->replInvalidChars($_SERVER['HTTP_REFERER'] ?? ''),
'Index'
),
];
if ('POST' === $method) {

View file

@ -117,7 +117,7 @@ class Current extends Action
*/
protected function getUserAgent(): string
{
return \trim($_SERVER['HTTP_USER_AGENT'] ?? '');
return \trim($this->c->Secury->replInvalidChars($_SERVER['HTTP_USER_AGENT'] ?? ''));
}
/**