diff --git a/src/Skobkin/Bundle/PointToolsBundle/Service/AbstractApi.php b/src/Skobkin/Bundle/PointToolsBundle/Service/AbstractApi.php index 4901d36..b78d3fd 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Service/AbstractApi.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Service/AbstractApi.php @@ -80,6 +80,7 @@ class AbstractApi public function sendPostRequest($path, array $parameters = []) { // Cleaning POST parameters from potential @file injections + // @todo move to new Guzzle array_walk($parameters, function (string &$value, string $key) { $value = str_replace('@', '', $value); }); diff --git a/src/Skobkin/Bundle/PointToolsBundle/Service/Telegram/PrivateMessageProcessor.php b/src/Skobkin/Bundle/PointToolsBundle/Service/Telegram/PrivateMessageProcessor.php index a65063b..a030c54 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Service/Telegram/PrivateMessageProcessor.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Service/Telegram/PrivateMessageProcessor.php @@ -207,12 +207,12 @@ class PrivateMessageProcessor private function linkAccount(Account $account, string $login, string $password): bool { - if ($this->userApi->isAuthDataValid($login, $password)) { - /** @var User $user */ - if (null === $user = $this->userRepo->findUserByLogin($login)) { - throw new CommandProcessingException('User not found in Point Tools database. Please try again later.'); - } + /** @var User $user */ + if (null === $user = $this->userRepo->findUserByLogin($login)) { + throw new CommandProcessingException('User not found in Point Tools database. Please try again later.'); + } + if ($this->userApi->isAuthDataValid($login, $password)) { $account->setUser($user); return true;