Recent fix additional fix.

This commit is contained in:
Alexey Skobkin 2017-01-06 00:30:52 +03:00
parent 7298c37f44
commit b51d2f1a6e
2 changed files with 6 additions and 5 deletions

View file

@ -80,6 +80,7 @@ class AbstractApi
public function sendPostRequest($path, array $parameters = []) public function sendPostRequest($path, array $parameters = [])
{ {
// Cleaning POST parameters from potential @file injections // Cleaning POST parameters from potential @file injections
// @todo move to new Guzzle
array_walk($parameters, function (string &$value, string $key) { array_walk($parameters, function (string &$value, string $key) {
$value = str_replace('@', '', $value); $value = str_replace('@', '', $value);
}); });

View file

@ -207,12 +207,12 @@ class PrivateMessageProcessor
private function linkAccount(Account $account, string $login, string $password): bool private function linkAccount(Account $account, string $login, string $password): bool
{ {
if ($this->userApi->isAuthDataValid($login, $password)) {
/** @var User $user */ /** @var User $user */
if (null === $user = $this->userRepo->findUserByLogin($login)) { if (null === $user = $this->userRepo->findUserByLogin($login)) {
throw new CommandProcessingException('User not found in Point Tools database. Please try again later.'); throw new CommandProcessingException('User not found in Point Tools database. Please try again later.');
} }
if ($this->userApi->isAuthDataValid($login, $password)) {
$account->setUser($user); $account->setUser($user);
return true; return true;