diff --git a/res/forum/api/upload_picture.php b/res/forum/api/upload_picture.php index 1392121..802dd7d 100644 --- a/res/forum/api/upload_picture.php +++ b/res/forum/api/upload_picture.php @@ -30,6 +30,12 @@ if (!isset($_POST["name"])) goto send; } +if (strlen($_POST["name"]) < 4) +{ + $status = 5; + goto send; +} + $file_format = strtolower(pathinfo($_FILES["file_upload"]["name"], PATHINFO_EXTENSION)); if (!in_array($file_format, $supported_formats)) diff --git a/res/forum/home/home.html b/res/forum/home/home.html index fe219f1..df18906 100644 --- a/res/forum/home/home.html +++ b/res/forum/home/home.html @@ -89,6 +89,10 @@ case 4: alert("Příliš velký obrázek!\nMaximální velikost je 5MB!"); break; + + case 5: + alert("Název musí být dlouhý alespoň 4 znaky!"); + break; } } });