Fix spacing in WallPresenter.php

This commit is contained in:
Jill Stingray 2020-06-11 23:18:05 +03:00
parent eba579046e
commit 3eb5b6b4fc

View file

@ -178,14 +178,6 @@ final class WallPresenter extends OpenVKPresenter
if($_FILES["_pic_attachment"]["error"] === UPLOAD_ERR_OK) {
try {
$post = new Post;
$post->setOwner($this->user->id);
$post->setWall($wall);
$post->setCreated(time());
$post->setContent($this->postParam("text"));
$post->setFlags($flags);
$post->save();
$photo = new Photo;
$photo->setOwner($this->user->id);
$photo->setDescription(iconv_substr($this->postParam("text"), 0, 36) . "...");
@ -200,6 +192,13 @@ final class WallPresenter extends OpenVKPresenter
$this->flashFail("err", "Не удалось опубликовать пост", "Файл повреждён.");
}
$post = new Post;
$post->setOwner($this->user->id);
$post->setWall($wall);
$post->setCreated(time());
$post->setContent($this->postParam("text"));
$post->setFlags($flags);
$post->save();
$post->attach($photo);
} elseif($this->postParam("text")) {
try {