minor fixes

renaming and removing a unused function
This commit is contained in:
nokonoko 2021-05-17 11:04:32 +02:00
parent d5d5880866
commit e36e72e5a7
2 changed files with 2 additions and 14 deletions

View File

@ -38,7 +38,7 @@ define('UGUU_FILES_ROOT', '/path/to/file/');
/* /*
* Maximum number of iterations while generating a new filename * Maximum number of iterations while generating a new filename
* *
* Pomf uses an algorithm to generate random filenames. Sometimes a file may * Uguu uses an algorithm to generate random filenames. Sometimes a file may
* exist under a randomly generated filename, so we count tries and keep trying. * exist under a randomly generated filename, so we count tries and keep trying.
* If this value is exceeded, we give up trying to generate a new filename. * If this value is exceeded, we give up trying to generate a new filename.
* *
@ -87,7 +87,7 @@ $FILTER_MODE = false;
/** /**
* Double dot file extensions. * Double dot file extensions.
* *
* Pomf keeps the last file extension for the uploaded file. In other words, an * Uguu keeps the last file extension for the uploaded file. In other words, an
* uploaded file with `.tar.gz` extension will be given a random filename which * uploaded file with `.tar.gz` extension will be given a random filename which
* ends in `.gz` unless configured here to ignore discards for `.tar.gz`. * ends in `.gz` unless configured here to ignore discards for `.tar.gz`.
* *

View File

@ -67,7 +67,6 @@ function generateName($file)
exit(0); exit(0);
} }
//Check if EXT is blacklisted //Check if EXT is blacklisted
if (in_array($ext, unserialize(CONFIG_BLOCKED_EXTENSIONS))) { if (in_array($ext, unserialize(CONFIG_BLOCKED_EXTENSIONS))) {
http_response_code(415); http_response_code(415);
@ -75,17 +74,6 @@ function generateName($file)
exit(0); exit(0);
} }
// Check blacklist DB
//$q = $db->prepare('SELECT hash, COUNT(*) AS count FROM blacklistedfiles WHERE hash = (:hash)');
//$q->bindValue(':hash', $file->getSha1(), PDO::PARAM_STR);
//$q->execute();
//$result = $q->fetch();
//if ($result['count'] > 0) {
// http_response_code(415);
// throw new UploadException(UPLOAD_ERR_BLACKLISTED);
// exit(0);
//}
// Check if a file with the same name does already exist in the database // Check if a file with the same name does already exist in the database
$q = $db->prepare('SELECT COUNT(filename) FROM files WHERE filename = (:name)'); $q = $db->prepare('SELECT COUNT(filename) FROM files WHERE filename = (:name)');
$q->bindValue(':name', $name, PDO::PARAM_STR); $q->bindValue(':name', $name, PDO::PARAM_STR);