fixed some stuff

This commit is contained in:
neerholt
2021-03-11 13:20:10 +01:00
parent 0e343cb46e
commit 1d1606ff13
8 changed files with 72 additions and 9 deletions
@@ -32,7 +32,7 @@ function imagesFileHandler(string $thumbnailFileName, string $thumbnailFileTmp){
$fileExtThumb = explode('.', $thumbnailFileName);
$fileActualExtThumb = strtolower(end($fileExtThumb));
$allowedFileTypeThumbnail = array('gif', 'jpeg', 'png', 'svg');
$allowedFileTypeThumbnail = array('gif', 'jpeg', 'png', 'svg', 'jpg', 'jfif', 'pjpeg', 'pjp', 'webp');
if(in_array($fileActualExtThumb,$allowedFileTypeThumbnail)){
$thumbnailFileNewName = uniqid("", true). "." . $fileActualExtThumb;
@@ -0,0 +1,21 @@
<?php
require_once "../../../bootstrap.php";
use \Backend\Models\GameData;
use \Backend\Models\Group;
use \Backend\Models\GameJam;
if(isset($_GET['gameDataId'])){
$openGameDataStream = GameData::find($_GET['gameDataId']);
}elseif(isset($_GET['groupId'])){
$openGameDataStream = Group::find($_GET['groupId'])->GameData();
}elseif (isset($_GET['gameJamId'])){
$openGameDataStream = Group::where("game_jam_id",$_GET['gameJamId'])->GameData();/*->pluck("id")->toArray()*/;
}else{
$openGameDataStream = GameData::all();
}
header('Content-Type: application/json;charset=UTF-8');
echo $openGameDataStream ->toJson(JSON_PRETTY_PRINT);