forked from gitbot/uguu
fixed empty db when not logging ip
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.
This commit is contained in:
parent
a06deebce9
commit
317f689904
@ -133,7 +133,8 @@ function uploadFile($file)
|
|||||||
if(LOG_IP == 'yes'){
|
if(LOG_IP == 'yes'){
|
||||||
$q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, ip) VALUES (:hash, :orig, :name, :size, :date, :ip)');
|
$q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, ip) VALUES (:hash, :orig, :name, :size, :date, :ip)');
|
||||||
}else{
|
}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
|
// Common parameters binding
|
||||||
$q->bindValue(':hash', $file->getSha1(), PDO::PARAM_STR);
|
$q->bindValue(':hash', $file->getSha1(), PDO::PARAM_STR);
|
||||||
|
Loading…
Reference in New Issue
Block a user