Login fix

This commit is contained in:
2021-03-12 11:10:14 +01:00
parent a31ed44bdd
commit c6e002d464
12 changed files with 43 additions and 35 deletions
@@ -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));