@@ -12,7 +12,7 @@ |
||
| 12 | 12 | <body> |
| 13 | 13 | <?php require(__DIR__ . "/../important/header.php"); |
| 14 | 14 | |
| 15 | - if(@$_POST['submit']) { |
|
| 15 | + if (@$_POST['submit']) { |
|
| 16 | 16 | $register = require(__DIR__ . "/../func/upload.php"); |
| 17 | 17 | $register("song", ["ogg", "mp3"]); |
| 18 | 18 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | <body> |
| 13 | 13 | <?php require(__DIR__ . "/../important/header.php"); |
| 14 | 14 | |
| 15 | - if(@$_POST['submit']) { |
|
| 15 | + if (@$_POST['submit']) { |
|
| 16 | 16 | $register = require(__DIR__ . "/../func/upload.php"); |
| 17 | 17 | $register("chiptune", ["xm", "mod", "s3m", "it"]); |
| 18 | 18 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | return function($type, $allowedFileTypes) { |
| 3 | - if(isset($_SESSION['user'])) { |
|
| 3 | + if (isset($_SESSION['user'])) { |
|
| 4 | 4 | $fileType = strtolower(pathinfo($_FILES["fileToUpload"]["name"], PATHINFO_EXTENSION)); |
| 5 | 5 | $target_dir = __DIR__ . "/../dynamic/" . $type . "/"; |
| 6 | 6 | $target_name = md5_file($_FILES["fileToUpload"]["tmp_name"]) . "." . $fileType; |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | $movedFile = move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - if(!in_array($fileType, $allowedFileTypes)) { |
|
| 18 | + if (!in_array($fileType, $allowedFileTypes)) { |
|
| 19 | 19 | echo 'unsupported file type. must be one of ' . join(", ", $allowedFileTypes) . '<hr>'; |
| 20 | 20 | $uploadOk = 0; |
| 21 | 21 | } |