forked from gitbot/uguu
minor fixes
renaming and removing a unused function
This commit is contained in:
parent
d5d5880866
commit
e36e72e5a7
@ -38,7 +38,7 @@ define('UGUU_FILES_ROOT', '/path/to/file/');
|
||||
/*
|
||||
* 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.
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
* ends in `.gz` unless configured here to ignore discards for `.tar.gz`.
|
||||
*
|
||||
|
@ -67,7 +67,6 @@ function generateName($file)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
//Check if EXT is blacklisted
|
||||
if (in_array($ext, unserialize(CONFIG_BLOCKED_EXTENSIONS))) {
|
||||
http_response_code(415);
|
||||
@ -75,17 +74,6 @@ function generateName($file)
|
||||
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
|
||||
$q = $db->prepare('SELECT COUNT(filename) FROM files WHERE filename = (:name)');
|
||||
$q->bindValue(':name', $name, PDO::PARAM_STR);
|
||||
|
Loading…
Reference in New Issue
Block a user