Skip to content
This repository was archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
Fix that eliminates the ability for other users to add posts
Browse files Browse the repository at this point in the history
  • Loading branch information
ostiwe committed Feb 14, 2020
1 parent 53e9177 commit cda9154
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ostiwe-saver/Client/UserClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ public function callbackHandler($callbackObj = [])
if (empty($callbackObj)) {
throw new Exception ('Empty message.');
}

if ($callbackObj['message']['from_id'] !== $this->userId) {
echo 'ok';
return;
}

if (!isset($callbackObj['group_id']) || empty($callbackObj['group_id'])) {
throw new Exception ('Param "group_id" is required.');
}
Expand Down

0 comments on commit cda9154

Please sign in to comment.