Skip to content

Commit

Permalink
Check not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuBarba committed Mar 23, 2024
1 parent 5309431 commit ddbcf22
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions upload_db_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
if (!preg_match("/\.sqlite?$/", $name)) {
$errormsg .= "<li>Wrong file type for $name (only .sqlite allowed)</li>";
$nerrors++;
} else if (filesize($tmp_name) == 0) {
$errormsg .= "<li>File is empty</li>";
$nerrors++;
} else {
# Just in case, to avoid collisions
$num = 1;
Expand Down

0 comments on commit ddbcf22

Please sign in to comment.