summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
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_sharing/lib
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_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php2
-rw-r--r--apps/files_sharing/lib/Helper.php4
-rw-r--r--apps/files_sharing/lib/ShareBackend/File.php8
-rw-r--r--apps/files_sharing/lib/ShareBackend/Folder.php4
4 files changed, 9 insertions, 9 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index df6f379d119..14fc8d63381 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -514,7 +514,7 @@ class ShareController extends Controller {
$this->emitAccessShareHook($share);
- $server_params = array( 'head' => $this->request->getMethod() == 'HEAD' );
+ $server_params = array( 'head' => $this->request->getMethod() === 'HEAD' );
/**
* Http range requests support
diff --git a/apps/files_sharing/lib/Helper.php b/apps/files_sharing/lib/Helper.php
index a659da9292f..c8f46fa8132 100644
--- a/apps/files_sharing/lib/Helper.php
+++ b/apps/files_sharing/lib/Helper.php
@@ -132,7 +132,7 @@ class Helper {
Filesystem::initMountPoints($owner);
$info = Filesystem::getFileInfo($target);
$ownerView = new View('/'.$owner.'/files');
- if ( $owner != User::getUser() ) {
+ if ( $owner !== User::getUser() ) {
$path = $ownerView->getPath($info['fileid']);
} else {
$path = $target;
@@ -183,7 +183,7 @@ class Helper {
$uid = User::getUser();
}
Filesystem::initMountPoints($uid);
- if ( $uid != User::getUser() ) {
+ if ( $uid !== User::getUser() ) {
$info = Filesystem::getFileInfo($filename);
$ownerView = new View('/'.$uid.'/files');
try {
diff --git a/apps/files_sharing/lib/ShareBackend/File.php b/apps/files_sharing/lib/ShareBackend/File.php
index aecb63c60e4..83474546581 100644
--- a/apps/files_sharing/lib/ShareBackend/File.php
+++ b/apps/files_sharing/lib/ShareBackend/File.php
@@ -123,7 +123,7 @@ class File implements \OCP\Share_Backend_File_Dependent {
}
public function formatItems($items, $format, $parameters = null) {
- if ($format == self::FORMAT_SHARED_STORAGE) {
+ if ($format === self::FORMAT_SHARED_STORAGE) {
// Only 1 item should come through for this format call
$item = array_shift($items);
return array(
@@ -133,7 +133,7 @@ class File implements \OCP\Share_Backend_File_Dependent {
'permissions' => $item['permissions'],
'uid_owner' => $item['uid_owner'],
);
- } else if ($format == self::FORMAT_GET_FOLDER_CONTENTS) {
+ } else if ($format === self::FORMAT_GET_FOLDER_CONTENTS) {
$files = array();
foreach ($items as $item) {
$file = array();
@@ -156,13 +156,13 @@ class File implements \OCP\Share_Backend_File_Dependent {
$files[] = $file;
}
return $files;
- } else if ($format == self::FORMAT_OPENDIR) {
+ } else if ($format === self::FORMAT_OPENDIR) {
$files = array();
foreach ($items as $item) {
$files[] = basename($item['file_target']);
}
return $files;
- } else if ($format == self::FORMAT_GET_ALL) {
+ } else if ($format === self::FORMAT_GET_ALL) {
$ids = array();
foreach ($items as $item) {
$ids[] = $item['file_source'];
diff --git a/apps/files_sharing/lib/ShareBackend/Folder.php b/apps/files_sharing/lib/ShareBackend/Folder.php
index 07e353cc6a6..55c2eff6fe0 100644
--- a/apps/files_sharing/lib/ShareBackend/Folder.php
+++ b/apps/files_sharing/lib/ShareBackend/Folder.php
@@ -83,7 +83,7 @@ class Folder extends File implements \OCP\Share_Backend_Collection {
$query = \OCP\DB::prepare('SELECT `id` FROM `*PREFIX*mimetypes` WHERE `mimetype` = ?');
$result = $query->execute(array('httpd/unix-directory'));
if ($row = $result->fetchRow()) {
- $mimetype = $row['id'];
+ $mimetype = (int) $row['id'];
} else {
$mimetype = -1;
}
@@ -96,7 +96,7 @@ class Folder extends File implements \OCP\Share_Backend_Collection {
while ($file = $result->fetchRow()) {
$children[] = array('source' => $file['fileid'], 'file_path' => $file['name']);
// If a child folder is found look inside it
- if ($file['mimetype'] == $mimetype) {
+ if ((int) $file['mimetype'] === $mimetype) {
$parents[] = $file['fileid'];
}
}