From ec83ec9a02bfbd532a24e3bb71188bb49929c772 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Fri, 20 May 2016 16:09:28 +0200 Subject: [PATCH] Fixing #53 Silencing warning when also having an exception when using ssh2_auth_pubkey_file() on PublicKeyFile::authenticate --- src/Ssh/Authentication/PublicKeyFile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Ssh/Authentication/PublicKeyFile.php b/src/Ssh/Authentication/PublicKeyFile.php index 2c651f0..28fa02e 100644 --- a/src/Ssh/Authentication/PublicKeyFile.php +++ b/src/Ssh/Authentication/PublicKeyFile.php @@ -37,7 +37,8 @@ public function __construct($username, $publicKeyFile, $privateKeyFile, $passPhr */ public function authenticate($session) { - return ssh2_auth_pubkey_file( + // It may throw n exception AND a warning, see https://github.com/Herzult/php-ssh/issues/53 + return @ssh2_auth_pubkey_file( $session, $this->username, $this->publicKeyFile,