Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nokonoko committed Dec 25, 2022
1 parent 751a97e commit e2c8b57
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Classes/Upload.php
Expand Up @@ -147,9 +147,6 @@ public function uploadFile(): array
$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);
Expand Down Expand Up @@ -191,10 +188,14 @@ public function fingerPrint(int $files_amount): void
{
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,
];
Expand Down

0 comments on commit e2c8b57

Please sign in to comment.