Pārlūkot izejas kodu

Add data filtering for HTTP_REFERER and HTTP_USER_AGENT

Visman 4 gadi atpakaļ
vecāks
revīzija
635f0ee4df

+ 1 - 1
app/Models/Pages/Auth.php

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

+ 4 - 1
app/Models/Pages/Email.php

@@ -46,7 +46,10 @@ class Email extends Page
         }
         }
 
 
         $data = [
         $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) {
         if ('POST' === $method) {

+ 1 - 1
app/Models/User/Current.php

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