@@ -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 | } |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | require(__DIR__ . "/conn.php"); |
| 4 | 4 | |
| 5 | 5 | return function($type, $allowedFileTypes) { |
| 6 | - if(isset($_SESSION['user'])) { |
|
| 6 | + if (isset($_SESSION['user'])) { |
|
| 7 | 7 | $fileType = strtolower(pathinfo($_FILES["fileToUpload"]["name"], PATHINFO_EXTENSION)); |
| 8 | 8 | $target_dir = __DIR__ . "/../dynamic/" . $type . "/"; |
| 9 | 9 | $target_name = md5_file($_FILES["fileToUpload"]["tmp_name"]) . "." . $fileType; |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | $movedFile = move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - if(!in_array($fileType, $allowedFileTypes)) { |
|
| 21 | + if (!in_array($fileType, $allowedFileTypes)) { |
|
| 22 | 22 | echo 'unsupported file type. must be one of ' . join(", ", $allowedFileTypes) . '<hr>'; |
| 23 | 23 | $uploadOk = 0; |
| 24 | 24 | } |