From b51d2f1a6e4066e52b75952ecb7543eb457dca54 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Fri, 6 Jan 2017 00:30:52 +0300 Subject: [PATCH] Recent fix additional fix. --- .../Bundle/PointToolsBundle/Service/AbstractApi.php | 1 + .../Service/Telegram/PrivateMessageProcessor.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) 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;