diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index b85415e28fc..d078790b6f0 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -1158,7 +1158,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$requirePostFilter = false;
}
// There was a time-range filter
- if ($componentType == 'VEVENT' && isset($filters['comp-filters'][0]['time-range'])) {
+ if ($componentType === 'VEVENT' && isset($filters['comp-filters'][0]['time-range'])) {
$timeRange = $filters['comp-filters'][0]['time-range'];
// If start time OR the end time is not specified, we can do a
diff --git a/apps/dav/lib/CalDAV/Search/SearchPlugin.php b/apps/dav/lib/CalDAV/Search/SearchPlugin.php
index d658a50437d..84e095da5f8 100644
--- a/apps/dav/lib/CalDAV/Search/SearchPlugin.php
+++ b/apps/dav/lib/CalDAV/Search/SearchPlugin.php
@@ -134,7 +134,7 @@ class SearchPlugin extends ServerPlugin {
// If we're dealing with the calendar home, the calendar home itself is
// responsible for the calendar-query
- if ($node instanceof CalendarHome && $depth == 2) {
+ if ($node instanceof CalendarHome && $depth === 2) {
$nodePaths = $node->calendarSearch($report->filters, $report->limit, $report->offset);
@@ -156,4 +156,4 @@ class SearchPlugin extends ServerPlugin {
$this->server->generateMultiStatus($result,
$prefer['return'] === 'minimal'));
}
-}
\ No newline at end of file
+}
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php
index 9dccffc022b..7c275611951 100644
--- a/apps/dav/lib/CardDAV/CardDavBackend.php
+++ b/apps/dav/lib/CardDAV/CardDavBackend.php
@@ -1019,7 +1019,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
}
$preferred = 0;
foreach($property->parameters as $parameter) {
- if ($parameter->name == 'TYPE' && strtoupper($parameter->getValue()) == 'PREF') {
+ if ($parameter->name === 'TYPE' && strtoupper($parameter->getValue()) === 'PREF') {
$preferred = 1;
break;
}
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..478321d41f2 100644
--- a/apps/dav/lib/Connector/Sabre/File.php
+++ b/apps/dav/lib/Connector/Sabre/File.php
@@ -146,8 +146,8 @@ class File extends Node implements IFile {
// double check if the file was fully received
// compare expected and actual size
if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] === 'PUT') {
- $expected = $_SERVER['CONTENT_LENGTH'];
- if ($count != $expected) {
+ $expected = (int) $_SERVER['CONTENT_LENGTH'];
+ if ($count !== $expected) {
throw new BadRequest('expected filesize ' . $expected . ' got ' . $count);
}
}
@@ -409,8 +409,8 @@ class File extends Node implements IFile {
//detect aborted upload
if (isset ($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT') {
if (isset($_SERVER['CONTENT_LENGTH'])) {
- $expected = $_SERVER['CONTENT_LENGTH'];
- if ($bytesWritten != $expected) {
+ $expected = (int) $_SERVER['CONTENT_LENGTH'];
+ 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 = '';
}
diff --git a/apps/dav/lib/DAV/Sharing/Backend.php b/apps/dav/lib/DAV/Sharing/Backend.php
index f662d8e1b80..6cc5e3b6f50 100644
--- a/apps/dav/lib/DAV/Sharing/Backend.php
+++ b/apps/dav/lib/DAV/Sharing/Backend.php
@@ -170,7 +170,7 @@ class Backend {
'href' => "principal:${row['principaluri']}",
'commonName' => isset($p['{DAV:}displayname']) ? $p['{DAV:}displayname'] : '',
'status' => 1,
- 'readOnly' => ($row['access'] == self::ACCESS_READ),
+ 'readOnly' => ((int) $row['access'] === self::ACCESS_READ),
'{http://owncloud.org/ns}principal' => $row['principaluri'],
'{http://owncloud.org/ns}group-share' => is_null($p)
];
diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php
index 9a9ac27b96f..6e1b7387c88 100644
--- a/apps/encryption/lib/Crypto/Crypt.php
+++ b/apps/encryption/lib/Crypto/Crypt.php
@@ -605,7 +605,7 @@ class Crypt {
$element = array_shift($exploded);
- while ($element != self::HEADER_END) {
+ while ($element !== self::HEADER_END) {
$result[$element] = array_shift($exploded);
$element = array_shift($exploded);
}
diff --git a/apps/encryption/lib/Crypto/Encryption.php b/apps/encryption/lib/Crypto/Encryption.php
index 1f8c8a8012e..4d20c103a5d 100644
--- a/apps/encryption/lib/Crypto/Encryption.php
+++ b/apps/encryption/lib/Crypto/Encryption.php
@@ -449,13 +449,13 @@ class Encryption implements IEncryptionModule {
return false;
}
- if ($parts[2] == 'files') {
+ if ($parts[2] === 'files') {
return true;
}
- if ($parts[2] == 'files_versions') {
+ if ($parts[2] === 'files_versions') {
return true;
}
- if ($parts[2] == 'files_trashbin') {
+ if ($parts[2] === 'files_trashbin') {
return true;
}
diff --git a/apps/files/ajax/download.php b/apps/files/ajax/download.php
index 17a7fd8b322..7c33cdec6dd 100644
--- a/apps/files/ajax/download.php
+++ b/apps/files/ajax/download.php
@@ -51,7 +51,7 @@ if(isset($_GET['downloadStartSecret'])
setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/');
}
-$server_params = array( 'head' => \OC::$server->getRequest()->getMethod() == 'HEAD' );
+$server_params = array( 'head' => \OC::$server->getRequest()->getMethod() === 'HEAD' );
/**
* Http range requests support
diff --git a/apps/files/lib/Helper.php b/apps/files/lib/Helper.php
index d2cebce5ddc..4a5595999d2 100644
--- a/apps/files/lib/Helper.php
+++ b/apps/files/lib/Helper.php
@@ -227,7 +227,7 @@ class Helper {
foreach ($filesById as $key => $fileWithTags) {
foreach($fileList as $key2 => $file){
- if( $file[$fileIdentifier] == $key){
+ if( $file[$fileIdentifier] === $key){
$fileList[$key2] = $fileWithTags;
}
}
diff --git a/apps/files/lib/Settings/Admin.php b/apps/files/lib/Settings/Admin.php
index da1d5deaf35..faaeb5b89c1 100644
--- a/apps/files/lib/Settings/Admin.php
+++ b/apps/files/lib/Settings/Admin.php
@@ -46,7 +46,7 @@ class Admin implements ISettings {
* @return TemplateResponse
*/
public function getForm() {
- $htaccessWorking = (getenv('htaccessWorking') == 'true');
+ $htaccessWorking = (getenv('htaccessWorking') === 'true');
$htaccessWritable = is_writable(\OC::$SERVERROOT.'/.htaccess');
$userIniWritable = is_writable(\OC::$SERVERROOT.'/.user.ini');
diff --git a/apps/files_external/ajax/oauth2.php b/apps/files_external/ajax/oauth2.php
index db2570800af..8b257b77ef6 100644
--- a/apps/files_external/ajax/oauth2.php
+++ b/apps/files_external/ajax/oauth2.php
@@ -46,8 +46,8 @@ if (isset($_POST['client_id']) && isset($_POST['client_secret']) && isset($_POST
$client->setApprovalPrompt('force');
$client->setAccessType('offline');
if (isset($_POST['step'])) {
- $step = $_POST['step'];
- if ($step == 1) {
+ $step = (int) $_POST['step'];
+ if ($step === 1) {
try {
$authUrl = $client->createAuthUrl();
OCP\JSON::success(array('data' => array(
@@ -58,7 +58,7 @@ if (isset($_POST['client_id']) && isset($_POST['client_secret']) && isset($_POST
'message' => $l->t('Step 1 failed. Exception: %s', array($exception->getMessage()))
)));
}
- } else if ($step == 2 && isset($_POST['code'])) {
+ } else if ($step === 2 && isset($_POST['code'])) {
try {
$token = $client->authenticate((string)$_POST['code']);
OCP\JSON::success(array('data' => array(
diff --git a/apps/files_external/lib/Command/Import.php b/apps/files_external/lib/Command/Import.php
index 96afc86ba2c..712a8851c8a 100644
--- a/apps/files_external/lib/Command/Import.php
+++ b/apps/files_external/lib/Command/Import.php
@@ -161,8 +161,8 @@ class Import extends Base {
if (
$existingMount->getMountPoint() === $mount->getMountPoint() &&
$existingMount->getApplicableGroups() === $mount->getApplicableGroups() &&
- $existingMount->getApplicableUsers() == $mount->getApplicableUsers() &&
- $existingMount->getBackendOptions() == $mount->getBackendOptions()
+ $existingMount->getApplicableUsers() === $mount->getApplicableUsers() &&
+ $existingMount->getBackendOptions() === $mount->getBackendOptions()
) {
$output->writeln("