aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Lib/Storage/SFTP.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-08-02 16:28:33 +0200
committerGitHub <noreply@github.com>2017-08-02 16:28:33 +0200
commit6290ba829980c51daaeb4959c24a714223aab613 (patch)
treedc3a38818177479a42e38191ad37a080dbdc00b9 /apps/files_external/lib/Lib/Storage/SFTP.php
parent1a711b1e739399c053fa93fcfa3dd9c81af25d8c (diff)
parenta20934227c35260e92f7978e9280b706262c4667 (diff)
downloadnextcloud-server-6290ba829980c51daaeb4959c24a714223aab613.tar.gz
nextcloud-server-6290ba829980c51daaeb4959c24a714223aab613.zip
Merge pull request #4790 from nextcloud/fix-comparisons-in-apps
Fix comparisons in apps
Diffstat (limited to 'apps/files_external/lib/Lib/Storage/SFTP.php')
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTP.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php
index a4dfea94bf7..8d489551264 100644
--- a/apps/files_external/lib/Lib/Storage/SFTP.php
+++ b/apps/files_external/lib/Lib/Storage/SFTP.php
@@ -102,11 +102,11 @@ class SFTP extends \OC\Files\Storage\Common {
$this->root
= isset($params['root']) ? $this->cleanPath($params['root']) : '/';
- if ($this->root[0] != '/') {
+ if ($this->root[0] !== '/') {
$this->root = '/' . $this->root;
}
- if (substr($this->root, -1, 1) != '/') {
+ if (substr($this->root, -1, 1) !== '/') {
$this->root .= '/';
}
}
@@ -128,7 +128,7 @@ class SFTP extends \OC\Files\Storage\Common {
// The SSH Host Key MUST be verified before login().
$currentHostKey = $this->client->getServerPublicHostKey();
if (array_key_exists($this->host, $hostKeys)) {
- if ($hostKeys[$this->host] != $currentHostKey) {
+ if ($hostKeys[$this->host] !== $currentHostKey) {
throw new \Exception('Host public key does not match known key');
}
} else {
@@ -248,7 +248,7 @@ class SFTP extends \OC\Files\Storage\Common {
if ($lines) {
foreach ($lines as $line) {
$hostKeyArray = explode("::", $line, 2);
- if (count($hostKeyArray) == 2) {
+ if (count($hostKeyArray) === 2) {
$hosts[] = $hostKeyArray[0];
$keys[] = $hostKeyArray[1];
}
@@ -300,7 +300,7 @@ class SFTP extends \OC\Files\Storage\Common {
$id = md5('sftp:' . $path);
$dirStream = array();
foreach($list as $file) {
- if ($file != '.' && $file != '..') {
+ if ($file !== '.' && $file !== '..') {
$dirStream[] = $file;
}
}
@@ -316,11 +316,11 @@ class SFTP extends \OC\Files\Storage\Common {
public function filetype($path) {
try {
$stat = $this->getConnection()->stat($this->absPath($path));
- if ($stat['type'] == NET_SFTP_TYPE_REGULAR) {
+ if ((int) $stat['type'] === NET_SFTP_TYPE_REGULAR) {
return 'file';
}
- if ($stat['type'] == NET_SFTP_TYPE_DIRECTORY) {
+ if ((int) $stat['type'] === NET_SFTP_TYPE_DIRECTORY) {
return 'dir';
}
} catch (\Exception $e) {