mirror of
https://github.com/openvk/openvk
synced 2025-03-14 13:35:33 +03:00
Fiksez
This commit is contained in:
parent
fead37f0a8
commit
971f793b96
2 changed files with 4 additions and 4 deletions
|
@ -43,7 +43,7 @@ final class Likes extends VKAPIRequestHandler
|
|||
if(is_null($postable) || $postable->isDeleted())
|
||||
$this->fail(100, "One of the parameters specified was missing or invalid: object not found");
|
||||
|
||||
if(!$postable->canBeViewedBy($this->getUser() ?? NULL)) {
|
||||
if(method_exists($postable, "canBeViewedBy") && !$postable->canBeViewedBy($this->getUser() ?? NULL)) {
|
||||
$this->fail(2, "Access to postable denied");
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ final class Likes extends VKAPIRequestHandler
|
|||
if(is_null($postable) || $postable->isDeleted())
|
||||
$this->fail(100, "One of the parameters specified was missing or invalid: object not found");
|
||||
|
||||
if(!$postable->canBeViewedBy($this->getUser() ?? NULL)) {
|
||||
if(method_exists($postable, "canBeViewedBy") && !$postable->canBeViewedBy($this->getUser() ?? NULL)) {
|
||||
$this->fail(2, "Access to postable denied");
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ final class Likes extends VKAPIRequestHandler
|
|||
if(is_null($user) || $user->isDeleted())
|
||||
$this->fail(100, "One of the parameters specified was missing or invalid: user not found");
|
||||
|
||||
if(!$user->canBeViewedBy($this->getUser())) {
|
||||
if(method_exists($user, "canBeViewedBy") && !$user->canBeViewedBy($this->getUser())) {
|
||||
$this->fail(1984, "Access denied: you can't see this user");
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ class Video extends Media
|
|||
];
|
||||
|
||||
if(!is_null($user)) {
|
||||
$res->likes = [
|
||||
$res->video["likes"] = [
|
||||
"count" => $this->getLikesCount(),
|
||||
"user_likes" => $this->hasLikeFrom($user)
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue