]> source.dussan.org Git - nextcloud-server.git/commitdiff
Handle no user set in sftp constructor
authorRobin Appelman <icewind@owncloud.com>
Tue, 26 Jan 2016 13:48:45 +0000 (14:48 +0100)
committerRobin Appelman <icewind@owncloud.com>
Tue, 26 Jan 2016 13:48:45 +0000 (14:48 +0100)
apps/files_external/lib/sftp.php

index ec808cd76dc1dccfd1a4d66a2ad800279576ddfe..09d743ff93d79a0af770a69cebab6b414186cc5d 100644 (file)
@@ -85,6 +85,9 @@ class SFTP extends \OC\Files\Storage\Common {
                $this->host = $parsedHost[0];
                $this->port = $parsedHost[1];
 
+               if (!isset($params['user'])) {
+                       throw new \UnexpectedValueException('no authentication parameters specified');
+               }
                $this->user = $params['user'];
 
                if (isset($params['public_key_auth'])) {