Compare commits

..

2 commits

Author SHA1 Message Date
koke228666
396780f602
Merge 60ed57a7f6 into b90a0fa013 2025-06-02 14:53:22 +03:00
mr❤️🤢
b90a0fa013
fix(photo upload): fix own page upload error (#1336) 2025-06-01 15:02:00 +00:00
2 changed files with 9 additions and 2 deletions

View file

@ -60,6 +60,11 @@ abstract class MediaCollection extends RowModel
} }
} }
public function getOwnerId(): int
{
return (int) $this->getRecord()->owner;
}
public function getPrettyId(): string public function getPrettyId(): string
{ {
return $this->getRecord()->owner . "_" . $this->getRecord()->id; return $this->getRecord()->owner . "_" . $this->getRecord()->id;

View file

@ -284,14 +284,16 @@ final class PhotosPresenter extends OpenVKPresenter
} }
if ($_SERVER["REQUEST_METHOD"] == "GET" || $this->queryParam("act") == "finish") { if ($_SERVER["REQUEST_METHOD"] == "GET" || $this->queryParam("act") == "finish") {
if (!$album) { if (!$album || $album->isCreatedBySystem()) {
$this->flashFail("err", tr("error"), tr("error_adding_to_deleted")); $this->flashFail("err", tr("error"), tr("error_adding_to_deleted"));
} }
} }
if ($album && !$album->canBeModifiedBy($this->user->identity)) { if ($album && !$album->canBeModifiedBy($this->user->identity)) {
if ($album->getOwnerId() != $this->user->id) {
$this->flashFail("err", tr("error_access_denied_short"), tr("error_access_denied")); $this->flashFail("err", tr("error_access_denied_short"), tr("error_access_denied"));
} }
}
if ($_SERVER["REQUEST_METHOD"] === "POST") { if ($_SERVER["REQUEST_METHOD"] === "POST") {
if ($this->queryParam("act") == "finish") { if ($this->queryParam("act") == "finish") {