mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
Fix video upload
This commit is contained in:
parent
6c872cdeca
commit
0049dbc5c7
1 changed files with 2 additions and 2 deletions
|
@ -51,7 +51,7 @@ final class VideosPresenter extends OpenVKPresenter
|
||||||
$this->assertUserLoggedIn();
|
$this->assertUserLoggedIn();
|
||||||
|
|
||||||
if($_SERVER["REQUEST_METHOD"] === "POST") {
|
if($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||||
if(empty($this->postParam("name"))) {
|
if(!empty($this->postParam("name"))) {
|
||||||
$video = new Video;
|
$video = new Video;
|
||||||
$video->setOwner($this->user->id);
|
$video->setOwner($this->user->id);
|
||||||
$video->setName($this->postParam("name"));
|
$video->setName($this->postParam("name"));
|
||||||
|
@ -72,7 +72,7 @@ final class VideosPresenter extends OpenVKPresenter
|
||||||
$video->save();
|
$video->save();
|
||||||
|
|
||||||
$this->redirect("/video" . $video->getPrettyId(), static::REDIRECT_TEMPORARY);
|
$this->redirect("/video" . $video->getPrettyId(), static::REDIRECT_TEMPORARY);
|
||||||
}else{
|
} else {
|
||||||
$this->flashFail("err", "Произошла ошибка", "Видео не может быть опубликовано без названия.");
|
$this->flashFail("err", "Произошла ошибка", "Видео не может быть опубликовано без названия.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue