This commit is contained in:
lalka2016 2023-09-14 18:11:53 +03:00
parent f4df916a7a
commit 28655503e1
2 changed files with 20 additions and 16 deletions

View file

@ -90,6 +90,7 @@ final class CommentPresenter extends OpenVKPresenter
$un = rtrim($this->postParam("videos"), ",");
$arr = explode(",", $un);
if(sizeof($arr) < 11) {
foreach($arr as $dat) {
$ids = explode("_", $dat);
$video = (new Videos)->getByOwnerAndVID((int)$ids[0], (int)$ids[1]);
@ -100,6 +101,7 @@ final class CommentPresenter extends OpenVKPresenter
$videos[] = $video;
}
}
}
if(empty($this->postParam("text")) && !$photo && !$video)
$this->flashFail("err", "Не удалось опубликовать комментарий", "Комментарий пустой или слишком большой.");

View file

@ -299,6 +299,7 @@ final class WallPresenter extends OpenVKPresenter
$un = rtrim($this->postParam("videos"), ",");
$arr = explode(",", $un);
if(sizeof($arr) < 11) {
foreach($arr as $dat) {
$ids = explode("_", $dat);
$video = (new Videos)->getByOwnerAndVID((int)$ids[0], (int)$ids[1]);
@ -309,6 +310,7 @@ final class WallPresenter extends OpenVKPresenter
$videos[] = $video;
}
}
}
if(empty($this->postParam("text")) && !$photo && sizeof($videos) < 1 && !$poll && !$note)
$this->flashFail("err", tr("failed_to_publish_post"), tr("post_is_empty_or_too_big"));