Fix video upload

This commit is contained in:
Jill Stingray 2020-06-11 12:50:23 +03:00
parent 6c872cdeca
commit 0049dbc5c7

View file

@ -51,7 +51,7 @@ final class VideosPresenter extends OpenVKPresenter
$this->assertUserLoggedIn();
if($_SERVER["REQUEST_METHOD"] === "POST") {
if(empty($this->postParam("name"))) {
if(!empty($this->postParam("name"))) {
$video = new Video;
$video->setOwner($this->user->id);
$video->setName($this->postParam("name"));
@ -72,7 +72,7 @@ final class VideosPresenter extends OpenVKPresenter
$video->save();
$this->redirect("/video" . $video->getPrettyId(), static::REDIRECT_TEMPORARY);
}else{
} else {
$this->flashFail("err", "Произошла ошибка", "Видео не может быть опубликовано без названия.");
}
}