mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Now Notes and Albums cannot be created with empty title
This commit is contained in:
parent
ad2e5ec8cc
commit
b08c33e092
2 changed files with 7 additions and 0 deletions
|
@ -54,6 +54,10 @@ final class NotesPresenter extends OpenVKPresenter
|
||||||
$this->notFound();
|
$this->notFound();
|
||||||
|
|
||||||
if($_SERVER["REQUEST_METHOD"] === "POST") {
|
if($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||||
|
if(empty($this->postParam("name"))) {
|
||||||
|
$this->flashFail("err", tr("error"), tr("error_segmentation"));
|
||||||
|
}
|
||||||
|
|
||||||
$note = new Note;
|
$note = new Note;
|
||||||
$note->setOwner($this->user->id);
|
$note->setOwner($this->user->id);
|
||||||
$note->setCreated(time());
|
$note->setCreated(time());
|
||||||
|
|
|
@ -68,6 +68,9 @@ final class PhotosPresenter extends OpenVKPresenter
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_SERVER["REQUEST_METHOD"] === "POST") {
|
if($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||||
|
if(empty($this->postParam("name"))) {
|
||||||
|
$this->flashFail("err", tr("error"), tr("error_segmentation"));
|
||||||
|
}
|
||||||
$album = new Album;
|
$album = new Album;
|
||||||
$album->setOwner(isset($club) ? $club->getId() * -1 : $this->user->id);
|
$album->setOwner(isset($club) ? $club->getId() * -1 : $this->user->id);
|
||||||
$album->setName($this->postParam("name"));
|
$album->setName($this->postParam("name"));
|
||||||
|
|
Loading…
Reference in a new issue