]> jfr.im git - uguu.git/commitdiff
fixed empty db when not logging ip
authornokonoko <redacted>
Mon, 21 Jun 2021 12:54:54 +0000 (14:54 +0200)
committernokonoko <redacted>
Mon, 21 Jun 2021 12:54:54 +0000 (14:54 +0200)
If you set the config value to no in order to not log IP's it would not insert anything to the DB because of the missing empty ip.

static/php/upload.php

index 3ec9d2e70aeb3bf96bcd521a57ebb42058c066b2..6c6786b691cbedbbd0106f4ec401e6664e4c73ec 100644 (file)
@@ -133,7 +133,8 @@ function uploadFile($file)
     if(LOG_IP == 'yes'){
         $q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, ip) VALUES (:hash, :orig, :name, :size, :date, :ip)');
     }else{
-           $q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date) VALUES (:hash, :orig, :name, :size, :date)');
+        $ip = '0';
+        $q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, ip) VALUES (:hash, :orig, :name, :size, :date, :ip)');
     }
     // Common parameters binding
     $q->bindValue(':hash', $file->getSha1(), PDO::PARAM_STR);