]> jfr.im git - uguu.git/commitdiff
fix v.1.6.5
authorGo Johansson <redacted>
Sun, 25 Dec 2022 15:39:10 +0000 (16:39 +0100)
committerGo Johansson <redacted>
Sun, 25 Dec 2022 15:39:10 +0000 (16:39 +0100)
src/Classes/Upload.php

index 64799121ddb6db4794b2745eb3ce56866b54797c..604463cde236bb8937d2102d9cceb49b32006eac 100644 (file)
@@ -147,9 +147,6 @@ class Upload extends Response
                 $this->checkMimeBlacklist();
                 $this->checkExtensionBlacklist();
                 // Continue
-            case !$this->Connector->CONFIG['LOG_IP']:
-                $this->fingerPrintInfo['ip'] = null;
-                // Continue
         }
         if (!is_dir($this->Connector->CONFIG['FILES_ROOT'])) {
             throw new Exception('File storage path not accessible.', 500);
@@ -191,10 +188,14 @@ class Upload extends Response
     {
         if (!empty($_SERVER['HTTP_USER_AGENT'])) {
             $USER_AGENT = filter_var($_SERVER['HTTP_USER_AGENT'], FILTER_SANITIZE_ENCODED);
+            $ip = null;
+            if ($this->Connector->CONFIG['LOG_IP']) {
+                $ip = $_SERVER['REMOTE_ADDR'];
+            }
             $this->fingerPrintInfo = [
                'timestamp'    => time(),
                'useragent'    => $USER_AGENT,
-               'ip'           => $_SERVER['REMOTE_ADDR'],
+               'ip'           => $ip,
                'ip_hash'      => hash('sha1', $_SERVER['REMOTE_ADDR'] . $USER_AGENT),
                'files_amount' => $files_amount,
             ];