Login fix
This commit is contained in:
@@ -2,14 +2,16 @@
|
||||
/**
|
||||
* @param string $gameFileName
|
||||
* @param string $gameFileTmp
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
|
||||
function ZipFileHandler(string $gameFileName, string $gameFileTmp){
|
||||
function ZipFileHandler(string $gameFileName, string $gameFileTmp): ?string
|
||||
{
|
||||
|
||||
$fileExtGame = explode('.', $gameFileName);
|
||||
$fileActualExtGame = strtolower(end($fileExtGame));
|
||||
|
||||
$allowedFileTypeGame = array('zip');
|
||||
$allowedFileTypeGame = array('zip');
|
||||
if(in_array($fileActualExtGame,$allowedFileTypeGame)){
|
||||
$gameFileNewName = uniqid("", true). "." . $fileActualExtGame;
|
||||
if(empty($gameFileName)){
|
||||
@@ -19,15 +21,19 @@ function ZipFileHandler(string $gameFileName, string $gameFileTmp){
|
||||
rename($gameFileTmp,"../../Games/".$gameFileNewName);
|
||||
return $gameFileNewName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $thumbnailFileName
|
||||
* @param string $thumbnailFileTmp
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
function imagesFileHandler(string $thumbnailFileName, string $thumbnailFileTmp){
|
||||
function imagesFileHandler(string $thumbnailFileName, string $thumbnailFileTmp): ?string
|
||||
{
|
||||
|
||||
$fileExtThumb = explode('.', $thumbnailFileName);
|
||||
$fileActualExtThumb = strtolower(end($fileExtThumb));
|
||||
|
||||
Reference in New Issue
Block a user