diff options
author | Joas Schilling <coding@schilljs.com> | 2017-05-10 14:03:14 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-08-01 13:55:07 +0200 |
commit | 89238164e12ba8532cdefed16a789cbd4e4efde5 (patch) | |
tree | d233da3070e605bd27603fff4e1a26a5082c42e6 /apps/dav/lib/Connector | |
parent | 0ebdf871e02653bf7e65bf5bdefaec7f92d3c677 (diff) | |
download | nextcloud-server-89238164e12ba8532cdefed16a789cbd4e4efde5.tar.gz nextcloud-server-89238164e12ba8532cdefed16a789cbd4e4efde5.zip |
Fix comparisons in the dav app
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/lib/Connector')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Directory.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/File.php | 4 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/ObjectTree.php | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php index 1a97d896469..6fe9d26614e 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -225,7 +225,7 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node throw new \Sabre\DAV\Exception\NotFound('File with name ' . $path . ' could not be located'); } - if ($info['mimetype'] == 'httpd/unix-directory') { + if ($info['mimetype'] === 'httpd/unix-directory') { $node = new \OCA\DAV\Connector\Sabre\Directory($this->fileView, $info, $this->tree, $this->shareManager); } else { $node = new \OCA\DAV\Connector\Sabre\File($this->fileView, $info, $this->shareManager); diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 63f10034ed6..9803beabe37 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -147,7 +147,7 @@ class File extends Node implements IFile { // compare expected and actual size if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { $expected = $_SERVER['CONTENT_LENGTH']; - if ($count != $expected) { + if ($count !== $expected) { throw new BadRequest('expected filesize ' . $expected . ' got ' . $count); } } @@ -410,7 +410,7 @@ class File extends Node implements IFile { if (isset ($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { if (isset($_SERVER['CONTENT_LENGTH'])) { $expected = $_SERVER['CONTENT_LENGTH']; - if ($bytesWritten != $expected) { + if ($bytesWritten !== $expected) { $chunk_handler->remove($info['index']); throw new BadRequest( 'expected filesize ' . $expected . ' got ' . $bytesWritten); diff --git a/apps/dav/lib/Connector/Sabre/ObjectTree.php b/apps/dav/lib/Connector/Sabre/ObjectTree.php index d298d6be842..3371c655f29 100644 --- a/apps/dav/lib/Connector/Sabre/ObjectTree.php +++ b/apps/dav/lib/Connector/Sabre/ObjectTree.php @@ -81,7 +81,7 @@ class ObjectTree extends \Sabre\DAV\Tree { if (isset($_SERVER['HTTP_OC_CHUNKED'])) { // resolve to real file name to find the proper node list($dir, $name) = \Sabre\Uri\split($path); - if ($dir == '/' || $dir == '.') { + if ($dir === '/' || $dir === '.') { $dir = ''; } |