fix sillyness

This commit is contained in:
Lee 2023-04-15 19:47:36 +01:00
parent 0932cad5d1
commit 6a23456110

@ -36,7 +36,7 @@ try {
$map = $_FILES["map"]; // the file to upload
if (!isset($map)) { // if the file is not set
header("Location: /?map=No file was uploaded");
header("Location: /?map=" . urlencode("No file was uploaded"));
die();
}
@ -45,12 +45,12 @@ try {
$size = $map["size"]; // the size of the file
if ($size > 100000000) { // if the file is larger than 100MB
header("Location: /?map=File is too large");
header("Location: /?map=" . urlencode("File is too large. Max file size is 100MB"));
die();
}
if (!isValidBeatSaberMap($file)) {
header("Location: /?map=This is not a valid BeatSaber map");
header("Location: /?map=" . urlencode("File is not a valid BeatSaber map. Please make sure you are uploading a .zip file"));
die();
}
@ -76,7 +76,7 @@ try {
$target_file = $target_dir . $mapId . ".zip"; // the output file path
if (!move_uploaded_file($file, $target_file)) {
error_log("Error: Failed to move uploaded file from $file to $target_file");
header("Location: /?map=Failed to upload file");
header("Location: /?map=" . urlencode("Failed to upload file. If this error persists, please contact me on Discord: Fascinated#7668"));
die();
}