Skip to content
This repository has been archived by the owner on May 10, 2020. It is now read-only.

Commit

Permalink
Correct checked variable for logging in
Browse files Browse the repository at this point in the history
  • Loading branch information
jacklul committed May 20, 2018
1 parent 599a493 commit 30edb2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/E621.php
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,8 @@ public function __call($action, array $data = [])
throw new InvalidArgumentException('Action "' . $action . '" doesn\'t exist!');
}

if (isset($this->actions[$action]['need_login']) && $this->actions[$action]['need_login'] === true && isset($data[0]) && (!isset($data[0]['user']) || !isset($data[0]['password_hash']))) {
throw new InvalidArgumentException('Action "' . $action . '" require logging in, provide "user" and "password_hash" parameters!');
if (isset($this->actions[$action]['need_login']) && $this->actions[$action]['need_login'] === true && isset($data[0]) && (!isset($data[0]['login']) || !isset($data[0]['password_hash']))) {
throw new InvalidArgumentException('Action "' . $action . '" require logging in, provide "login" and "password_hash" parameters!');
}

return $this->request($this->actions[$action]['path'], isset($data[0]) ? $data[0] : null, $this->actions[$action]['method'], $this->actions[$action]['class']);
Expand Down

0 comments on commit 30edb2c

Please sign in to comment.