diff options
author | Joas Schilling <coding@schilljs.com> | 2017-05-10 14:16:22 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-08-01 13:56:12 +0200 |
commit | 80febeae21a30e0c1a040b99860983dfd484556b (patch) | |
tree | 45a4bd305f55ece37dcaa0ee7adf322421d93e87 /apps | |
parent | 7a62fbd205874355abb3b551b182bc61b9c3d3e1 (diff) | |
download | nextcloud-server-80febeae21a30e0c1a040b99860983dfd484556b.tar.gz nextcloud-server-80febeae21a30e0c1a040b99860983dfd484556b.zip |
Fix comparisons in the sharing app
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareController.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/lib/Helper.php | 4 | ||||
-rw-r--r-- | apps/files_sharing/lib/ShareBackend/File.php | 8 | ||||
-rw-r--r-- | apps/files_sharing/lib/ShareBackend/Folder.php | 4 | ||||
-rw-r--r-- | apps/files_sharing/templates/public.php | 2 |
5 files changed, 10 insertions, 10 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']; } } diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 36b4dcdbe1c..f8d056ef93c 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -75,7 +75,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size); <?php if (isset($_['folder'])): ?> <?php print_unescaped($_['folder']); ?> <?php else: ?> - <?php if ($_['previewEnabled'] && substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?> + <?php if ($_['previewEnabled'] && substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) === 'video'): ?> <div id="imgframe"> <video tabindex="0" controls="" preload="none" style="max-width: <?php p($_['previewMaxX']); ?>px; max-height: <?php p($_['previewMaxY']); ?>px"> <source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" /> |