diff options
author | Roeland Douma <rullzer@users.noreply.github.com> | 2016-07-08 13:49:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-08 13:49:42 +0200 |
commit | 48f9e4ed03f3148d62919a95496ee43164d3e707 (patch) | |
tree | 473604ce19265a36c8230bc5efc01ca906152f80 | |
parent | a84250e0afdb98d07b268914b56c8763c17f5a73 (diff) | |
parent | 6da066e7be9ad77f9591d993df92156c9f184624 (diff) | |
download | nextcloud-server-48f9e4ed03f3148d62919a95496ee43164d3e707.tar.gz nextcloud-server-48f9e4ed03f3148d62919a95496ee43164d3e707.zip |
Merge pull request #317 from nextcloud/scrutinizer-fixed
Scrutinizer fixes
-rw-r--r-- | apps/dav/lib/CalDAV/BirthdayService.php | 6 | ||||
-rw-r--r-- | apps/dav/lib/CardDAV/ContactsManager.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/DAV/Sharing/Xml/Invite.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Files/CustomPropertiesBackend.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Server.php | 6 | ||||
-rw-r--r-- | apps/dav/tests/unit/ServerTest.php | 2 | ||||
-rw-r--r-- | apps/federation/lib/BackgroundJob/GetSharedSecret.php | 2 | ||||
-rw-r--r-- | apps/federation/lib/DbHandler.php | 4 | ||||
-rw-r--r-- | apps/files_external/js/rollingqueue.js | 4 | ||||
-rw-r--r-- | apps/files_external/js/statusmanager.js | 6 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/Storage/AmazonS3.php | 3 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SFTP.php | 4 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SMB.php | 2 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/Storage/Swift.php | 4 | ||||
-rw-r--r-- | apps/files_sharing/ajax/shareinfo.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/js/sharetabview.js | 2 | ||||
-rw-r--r-- | apps/files_sharing/lib/Controllers/ShareController.php | 27 | ||||
-rw-r--r-- | apps/files_sharing/lib/Migration.php | 3 | ||||
-rw-r--r-- | apps/files_versions/js/versionstabview.js | 2 |
19 files changed, 55 insertions, 30 deletions
diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index 26e3d22ce4e..573713d2a98 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -35,6 +35,12 @@ class BirthdayService { /** @var GroupPrincipalBackend */ private $principalBackend; + /** @var CalDavBackend */ + private $calDavBackEnd; + + /** @var CardDavBackend */ + private $cardDavBackEnd; + /** * BirthdayService constructor. * diff --git a/apps/dav/lib/CardDAV/ContactsManager.php b/apps/dav/lib/CardDAV/ContactsManager.php index ad633483fdd..a9f35d53d76 100644 --- a/apps/dav/lib/CardDAV/ContactsManager.php +++ b/apps/dav/lib/CardDAV/ContactsManager.php @@ -25,6 +25,8 @@ use OCP\Contacts\IManager; use OCP\IURLGenerator; class ContactsManager { + /** @var CardDavBackend */ + private $backend; /** * ContactsManager constructor. diff --git a/apps/dav/lib/DAV/Sharing/Xml/Invite.php b/apps/dav/lib/DAV/Sharing/Xml/Invite.php index a14de7bc634..7ffe9a322c1 100644 --- a/apps/dav/lib/DAV/Sharing/Xml/Invite.php +++ b/apps/dav/lib/DAV/Sharing/Xml/Invite.php @@ -50,7 +50,7 @@ class Invite implements XmlSerializable { * The organizer contains information about the person who shared the * object. * - * @var array + * @var array|null */ protected $organizer; diff --git a/apps/dav/lib/Files/CustomPropertiesBackend.php b/apps/dav/lib/Files/CustomPropertiesBackend.php index aa541f88dad..41c596b9612 100644 --- a/apps/dav/lib/Files/CustomPropertiesBackend.php +++ b/apps/dav/lib/Files/CustomPropertiesBackend.php @@ -58,7 +58,7 @@ class CustomPropertiesBackend implements BackendInterface { private $connection; /** - * @var IUser + * @var string */ private $user; diff --git a/apps/dav/lib/Server.php b/apps/dav/lib/Server.php index 7fa1b13783b..0715d39049c 100644 --- a/apps/dav/lib/Server.php +++ b/apps/dav/lib/Server.php @@ -43,6 +43,12 @@ class Server { /** @var IRequest */ private $request; + /** @var string */ + private $baseUri; + + /** @var Connector\Sabre\Server */ + private $server; + public function __construct(IRequest $request, $baseUri) { $this->request = $request; $this->baseUri = $baseUri; diff --git a/apps/dav/tests/unit/ServerTest.php b/apps/dav/tests/unit/ServerTest.php index 83f14db88f1..97c165683bd 100644 --- a/apps/dav/tests/unit/ServerTest.php +++ b/apps/dav/tests/unit/ServerTest.php @@ -39,6 +39,6 @@ class ServerTest extends \Test\TestCase { $r = $this->getMockBuilder('\OCP\IRequest') ->disableOriginalConstructor()->getMock(); $s = new Server($r, '/'); - $this->assertNotNull($s->server); + $this->assertInstanceOf('OCA\DAV\Server', $s); } } diff --git a/apps/federation/lib/BackgroundJob/GetSharedSecret.php b/apps/federation/lib/BackgroundJob/GetSharedSecret.php index 5e2f80c8a97..2a7d5ad8ef6 100644 --- a/apps/federation/lib/BackgroundJob/GetSharedSecret.php +++ b/apps/federation/lib/BackgroundJob/GetSharedSecret.php @@ -130,7 +130,7 @@ class GetSharedSecret extends Job{ * @param JobList $jobList * @param ILogger $logger */ - protected function parentExecute($jobList, $logger) { + protected function parentExecute($jobList, $logger = null) { parent::execute($jobList, $logger); } diff --git a/apps/federation/lib/DbHandler.php b/apps/federation/lib/DbHandler.php index 015a06c035c..5cfbc9f021a 100644 --- a/apps/federation/lib/DbHandler.php +++ b/apps/federation/lib/DbHandler.php @@ -43,7 +43,7 @@ class DbHandler { private $connection; /** @var IL10N */ - private $l; + private $IL10N; /** @var string */ private $dbTable = 'trusted_servers'; @@ -87,7 +87,7 @@ class DbHandler { return (int)$this->connection->lastInsertId('*PREFIX*'.$this->dbTable); } else { $message = 'Internal failure, Could not add ownCloud as trusted server: ' . $url; - $message_t = $this->l->t('Could not add server'); + $message_t = $this->IL10N->t('Could not add server'); throw new HintException($message, $message_t); } } diff --git a/apps/files_external/js/rollingqueue.js b/apps/files_external/js/rollingqueue.js index 58cb0fb22f0..53e11cb1219 100644 --- a/apps/files_external/js/rollingqueue.js +++ b/apps/files_external/js/rollingqueue.js @@ -70,7 +70,7 @@ var RollingQueue = function (functionList, queueWindow, callback) { throw "functionList must be an array"; } - for (i = 0; i < this.queueWindow; i++) { + for (var i = 0; i < this.queueWindow; i++) { this.launchNext(); } }; @@ -134,4 +134,4 @@ if (!OCA.External.StatusManager) { OCA.External.StatusManager.RollingQueue = RollingQueue; -})();
\ No newline at end of file +})(); diff --git a/apps/files_external/js/statusmanager.js b/apps/files_external/js/statusmanager.js index 91974f2d04d..437e9178d24 100644 --- a/apps/files_external/js/statusmanager.js +++ b/apps/files_external/js/statusmanager.js @@ -12,6 +12,8 @@ * */ +/** @global Handlebars */ + if (!OCA.External) { OCA.External = {}; } @@ -502,7 +504,7 @@ OCA.External.StatusManager.Utils = { trFolder = $('#fileList tr[data-file=\"' + OCA.External.StatusManager.Utils.jqSelEscape(folder) + '\"]'); } trFolder.removeClass('externalErroredRow').removeClass('externalDisabledRow'); - tdChilds = trFolder.find("td:first-child div.thumbnail"); + var tdChilds = trFolder.find("td:first-child div.thumbnail"); tdChilds.each(function () { var thisElement = $(this); thisElement.css('background-image', thisElement.data('oldImage')); @@ -525,7 +527,7 @@ OCA.External.StatusManager.Utils = { }); } else { file = $("#fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td:first-child div.thumbnail"); - parentTr = file.parents('tr:first'); + var parentTr = file.parents('tr:first'); route = OCA.External.StatusManager.Utils.getIconRoute(parentTr); parentTr.attr("data-icon", route); file.css('background-image', "url(" + route + ")").css('display', 'none').css('display', 'inline'); diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index 4bb4312a54f..d67db9858ca 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -74,6 +74,9 @@ class AmazonS3 extends \OC\Files\Storage\Common { */ private $rescanDelay = 10; + /** @var string */ + private $id; + /** * @param string $path * @return string correctly encoded path diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php index c058cb98483..3be7a801229 100644 --- a/apps/files_external/lib/Lib/Storage/SFTP.php +++ b/apps/files_external/lib/Lib/Storage/SFTP.php @@ -49,8 +49,8 @@ class SFTP extends \OC\Files\Storage\Common { private $auth; /** - * @var SFTP - */ + * @var \phpseclib\Net\SFTP + */ protected $client; /** diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index 9f74aa881e0..e677f8c9eba 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -221,7 +221,7 @@ class SMB extends \OC\Files\Storage\Common { /** * @param string $path * @param string $mode - * @return resource + * @return resource|false */ public function fopen($path, $mode) { $fullPath = $this->buildPath($path); diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php index d015e71f9d9..b7f833f9e72 100644 --- a/apps/files_external/lib/Lib/Storage/Swift.php +++ b/apps/files_external/lib/Lib/Storage/Swift.php @@ -68,6 +68,10 @@ class Swift extends \OC\Files\Storage\Common { * @var array */ private $params; + + /** @var string */ + private $id; + /** * @var array */ diff --git a/apps/files_sharing/ajax/shareinfo.php b/apps/files_sharing/ajax/shareinfo.php index 002d7ab275e..0b93e3d2ee9 100644 --- a/apps/files_sharing/ajax/shareinfo.php +++ b/apps/files_sharing/ajax/shareinfo.php @@ -71,7 +71,7 @@ $shareManager = \OC::$server->getShareManager(); $share = $shareManager->getShareByToken($token); $sharePermissions= (int)$share->getPermissions(); -if(!($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) { +if($rootInfo === false || !($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) { OCP\JSON::error(array('data' => 'Share is not readable.')); exit(); } diff --git a/apps/files_sharing/js/sharetabview.js b/apps/files_sharing/js/sharetabview.js index e24320604fb..2c7070aa3d5 100644 --- a/apps/files_sharing/js/sharetabview.js +++ b/apps/files_sharing/js/sharetabview.js @@ -8,6 +8,8 @@ * */ +/* @global Handlebars */ + (function() { var TEMPLATE = '<div>' + diff --git a/apps/files_sharing/lib/Controllers/ShareController.php b/apps/files_sharing/lib/Controllers/ShareController.php index 56f94b91c80..11359e5f2f2 100644 --- a/apps/files_sharing/lib/Controllers/ShareController.php +++ b/apps/files_sharing/lib/Controllers/ShareController.php @@ -285,19 +285,6 @@ class ShareController extends Controller { throw $e; } - $rootFolder = null; - if ($share->getNode() instanceof \OCP\Files\Folder) { - /** @var \OCP\Files\Folder $rootFolder */ - $rootFolder = $share->getNode(); - - try { - $path = $rootFolder->get($path); - } catch (\OCP\Files\NotFoundException $e) { - $this->emitAccessShareHook($share, 404, 'Share not found'); - throw new NotFoundException(); - } - } - $shareTmpl = []; $shareTmpl['displayName'] = $this->userManager->get($share->getShareOwner())->getDisplayName(); $shareTmpl['owner'] = $share->getShareOwner(); @@ -316,7 +303,17 @@ class ShareController extends Controller { // Show file list $hideFileList = false; if ($share->getNode() instanceof \OCP\Files\Folder) { - $shareTmpl['dir'] = $rootFolder->getRelativePath($path->getPath()); + /** @var \OCP\Files\Folder $rootFolder */ + $rootFolder = $share->getNode(); + + try { + $folderNode = $rootFolder->get($path); + } catch (\OCP\Files\NotFoundException $e) { + $this->emitAccessShareHook($share, 404, 'Share not found'); + throw new NotFoundException(); + } + + $shareTmpl['dir'] = $rootFolder->getRelativePath($folderNode->getPath()); /* * The OC_Util methods require a view. This just uses the node API @@ -333,7 +330,7 @@ class ShareController extends Controller { $hideFileList = $share->getPermissions() & \OCP\Constants::PERMISSION_READ ? false : true; $folder = new Template('files', 'list', ''); - $folder->assign('dir', $rootFolder->getRelativePath($path->getPath())); + $folder->assign('dir', $rootFolder->getRelativePath($folderNode->getPath())); $folder->assign('dirToken', $token); $folder->assign('permissions', \OCP\Constants::PERMISSION_READ); $folder->assign('isPublic', true); diff --git a/apps/files_sharing/lib/Migration.php b/apps/files_sharing/lib/Migration.php index ad3d026d0f6..b3759ea7b5f 100644 --- a/apps/files_sharing/lib/Migration.php +++ b/apps/files_sharing/lib/Migration.php @@ -24,6 +24,7 @@ namespace OCA\Files_Sharing; use Doctrine\DBAL\Connection; +use OCP\ICache; use OCP\IDBConnection; use OC\Cache\CappedMemoryCache; @@ -38,7 +39,7 @@ class Migration { /** @var IDBConnection */ private $connection; - /** @var array with all shares we already saw */ + /** @var ICache with all shares we already saw */ private $shareCache; /** @var string */ diff --git a/apps/files_versions/js/versionstabview.js b/apps/files_versions/js/versionstabview.js index b9ccf03c3e2..2424778b4ee 100644 --- a/apps/files_versions/js/versionstabview.js +++ b/apps/files_versions/js/versionstabview.js @@ -8,6 +8,8 @@ * */ +/* @global Handlebars */ + (function() { var TEMPLATE_ITEM = '<li data-revision="{{timestamp}}">' + |