Skip to content

Commit

Permalink
Added is_resource call to ftp_ functions wrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daim Piekaerts committed Nov 2, 2017
1 parent 547bf1e commit 863899c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/FtpClient/FtpWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ public function __call($function, array $arguments)
$function = 'ftp_' . $function;

if (function_exists($function)) {
array_unshift($arguments, $this->conn);
return call_user_func_array($function, $arguments);
if (is_resource($this->conn)) {
array_unshift($arguments, $this->conn);
return call_user_func_array($function, $arguments);
}

return null;
}

throw new FtpException("{$function} is not a valid FTP function");
Expand Down

0 comments on commit 863899c

Please sign in to comment.