mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Clubs&Albums: Fix of empty names of albums and clubs (#936)
This commit is contained in:
parent
5c76b56da4
commit
4a65096e64
2 changed files with 4 additions and 4 deletions
|
@ -39,7 +39,7 @@ final class GroupPresenter extends OpenVKPresenter
|
|||
$this->willExecuteWriteAction();
|
||||
|
||||
if($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
if(!empty($this->postParam("name")))
|
||||
if(!empty($this->postParam("name")) && mb_strlen(trim($this->postParam("name"))) > 0)
|
||||
{
|
||||
$club = new Club;
|
||||
$club->setName($this->postParam("name"));
|
||||
|
@ -201,7 +201,7 @@ final class GroupPresenter extends OpenVKPresenter
|
|||
if(!$club->setShortcode( empty($this->postParam("shortcode")) ? NULL : $this->postParam("shortcode") ))
|
||||
$this->flashFail("err", tr("error"), tr("error_shorturl_incorrect"));
|
||||
|
||||
$club->setName(empty($this->postParam("name")) ? $club->getName() : $this->postParam("name"));
|
||||
$club->setName((empty($this->postParam("name")) || mb_strlen(trim($this->postParam("name"))) === 0) ? $club->getName() : $this->postParam("name"));
|
||||
$club->setAbout(empty($this->postParam("about")) ? NULL : $this->postParam("about"));
|
||||
$club->setWall(empty($this->postParam("wall")) ? 0 : 1);
|
||||
$club->setAdministrators_List_Display(empty($this->postParam("administrators_list_display")) ? 0 : $this->postParam("administrators_list_display"));
|
||||
|
|
|
@ -66,7 +66,7 @@ final class PhotosPresenter extends OpenVKPresenter
|
|||
}
|
||||
|
||||
if($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
if(empty($this->postParam("name")))
|
||||
if(empty($this->postParam("name")) || mb_strlen(trim($this->postParam("name"))) === 0)
|
||||
$this->flashFail("err", tr("error"), tr("error_segmentation"));
|
||||
else if(strlen($this->postParam("name")) > 36)
|
||||
$this->flashFail("err", tr("error"), tr("error_data_too_big", "name", 36, "bytes"));
|
||||
|
@ -101,7 +101,7 @@ final class PhotosPresenter extends OpenVKPresenter
|
|||
if(strlen($this->postParam("name")) > 36)
|
||||
$this->flashFail("err", tr("error"), tr("error_data_too_big", "name", 36, "bytes"));
|
||||
|
||||
$album->setName(empty($this->postParam("name")) ? $album->getName() : $this->postParam("name"));
|
||||
$album->setName((empty($this->postParam("name")) || mb_strlen(trim($this->postParam("name"))) === 0) ? $album->getName() : $this->postParam("name"));
|
||||
$album->setDescription(empty($this->postParam("desc")) ? NULL : $this->postParam("desc"));
|
||||
$album->setEdited(time());
|
||||
$album->save();
|
||||
|
|
Loading…
Reference in a new issue