@@ -190,8 +190,12 @@ function upload($files, $CONF, $db) | |||
$file_used = true; | |||
while ($file_used) | |||
{ | |||
$randomString = rand_string(6); | |||
$fileURL = $randomString.".".$ext; | |||
$randomString = rand_string(6); | |||
if (empty($ext)) { | |||
$fileURL = $randomString; | |||
} else { | |||
$fileURL = $randomString.".".$ext; | |||
} | |||
$result = $db->select("uploads", "url=?", array($fileURL)); | |||
if (!$result) | |||
{ |