diff options
Diffstat (limited to 'lib')
24 files changed, 170 insertions, 137 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index a217a704448..a1960f678fd 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -1011,6 +1011,7 @@ return array( 'OC\\Files\\Cache\\HomePropagator' => $baseDir . '/lib/private/Files/Cache/HomePropagator.php', 'OC\\Files\\Cache\\LocalRootScanner' => $baseDir . '/lib/private/Files/Cache/LocalRootScanner.php', 'OC\\Files\\Cache\\MoveFromCacheTrait' => $baseDir . '/lib/private/Files/Cache/MoveFromCacheTrait.php', + 'OC\\Files\\Cache\\NullWatcher' => $baseDir . '/lib/private/Files/Cache/NullWatcher.php', 'OC\\Files\\Cache\\Propagator' => $baseDir . '/lib/private/Files/Cache/Propagator.php', 'OC\\Files\\Cache\\QuerySearchHelper' => $baseDir . '/lib/private/Files/Cache/QuerySearchHelper.php', 'OC\\Files\\Cache\\Scanner' => $baseDir . '/lib/private/Files/Cache/Scanner.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 9e46855f1eb..8c7db5e5723 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -1040,6 +1040,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Files\\Cache\\HomePropagator' => __DIR__ . '/../../..' . '/lib/private/Files/Cache/HomePropagator.php', 'OC\\Files\\Cache\\LocalRootScanner' => __DIR__ . '/../../..' . '/lib/private/Files/Cache/LocalRootScanner.php', 'OC\\Files\\Cache\\MoveFromCacheTrait' => __DIR__ . '/../../..' . '/lib/private/Files/Cache/MoveFromCacheTrait.php', + 'OC\\Files\\Cache\\NullWatcher' => __DIR__ . '/../../..' . '/lib/private/Files/Cache/NullWatcher.php', 'OC\\Files\\Cache\\Propagator' => __DIR__ . '/../../..' . '/lib/private/Files/Cache/Propagator.php', 'OC\\Files\\Cache\\QuerySearchHelper' => __DIR__ . '/../../..' . '/lib/private/Files/Cache/QuerySearchHelper.php', 'OC\\Files\\Cache\\Scanner' => __DIR__ . '/../../..' . '/lib/private/Files/Cache/Scanner.php', diff --git a/lib/l10n/pl.js b/lib/l10n/pl.js index 4e131b8e382..77a203ee566 100644 --- a/lib/l10n/pl.js +++ b/lib/l10n/pl.js @@ -115,7 +115,7 @@ OC.L10N.register( "Can’t increase permissions of %s" : "Nie można zwiększyć uprawnień %s", "Files can’t be shared with delete permissions" : "Pliki nie mogą zostać udostępnione z prawem do usuwania", "Files can’t be shared with create permissions" : "Pliki nie mogą zostać udostępnione z prawem do tworzenia", - "Expiration date is in the past" : "Data ważności jest przeszła", + "Expiration date is in the past" : "Data ważności już minęła", "Can’t set expiration date more than %s days in the future" : "Nie można ustawić daty ważności na dłuższą niż %s dni", "%1$s shared »%2$s« with you" : "%1$s udostępnił Tobie »%2$s«", "%1$s shared »%2$s« with you." : "%1$s udostępnił Tobie »%2$s«.", diff --git a/lib/l10n/pl.json b/lib/l10n/pl.json index a7d5bd7f445..a5de172c00e 100644 --- a/lib/l10n/pl.json +++ b/lib/l10n/pl.json @@ -113,7 +113,7 @@ "Can’t increase permissions of %s" : "Nie można zwiększyć uprawnień %s", "Files can’t be shared with delete permissions" : "Pliki nie mogą zostać udostępnione z prawem do usuwania", "Files can’t be shared with create permissions" : "Pliki nie mogą zostać udostępnione z prawem do tworzenia", - "Expiration date is in the past" : "Data ważności jest przeszła", + "Expiration date is in the past" : "Data ważności już minęła", "Can’t set expiration date more than %s days in the future" : "Nie można ustawić daty ważności na dłuższą niż %s dni", "%1$s shared »%2$s« with you" : "%1$s udostępnił Tobie »%2$s«", "%1$s shared »%2$s« with you." : "%1$s udostępnił Tobie »%2$s«.", diff --git a/lib/private/BackgroundJob/JobList.php b/lib/private/BackgroundJob/JobList.php index d9d80374cfd..37aecd61693 100644 --- a/lib/private/BackgroundJob/JobList.php +++ b/lib/private/BackgroundJob/JobList.php @@ -180,7 +180,6 @@ class JobList implements IJobList { * get the next job in the list * * @return IJob|null - * @suppress SqlInjectionChecker */ public function getNext() { $query = $this->connection->getQueryBuilder(); @@ -300,7 +299,6 @@ class JobList implements IJobList { * Remove the reservation for a job * * @param IJob $job - * @suppress SqlInjectionChecker */ public function unlockJob(IJob $job) { $query = $this->connection->getQueryBuilder(); diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index a0a670817f4..1acfe79824c 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -594,8 +594,6 @@ class Manager implements ICommentsManager { * @param int $folderId * @param IUser $user * @return array [$fileId => $unreadCount] - * - * @suppress SqlInjectionChecker */ public function getNumberOfUnreadCommentsForFolder($folderId, IUser $user) { $qb = $this->dbConn->getQueryBuilder(); @@ -935,7 +933,6 @@ class Manager implements ICommentsManager { * @param \DateTime $dateTime * @param IUser $user * @since 9.0.0 - * @suppress SqlInjectionChecker */ public function setReadMark($objectType, $objectId, \DateTime $dateTime, IUser $user) { $this->checkRoleParameters('Object', $objectType, $objectId); diff --git a/lib/private/DB/Adapter.php b/lib/private/DB/Adapter.php index f27a90dd690..562fea25f5c 100644 --- a/lib/private/DB/Adapter.php +++ b/lib/private/DB/Adapter.php @@ -130,9 +130,6 @@ class Adapter { } } - /** - * @suppress SqlInjectionChecker - */ public function insertIgnoreConflict(string $table,array $values) : int { try { $builder = $this->conn->getQueryBuilder(); diff --git a/lib/private/DB/AdapterPgSql.php b/lib/private/DB/AdapterPgSql.php index 7f7f5150780..77f0b6b7722 100644 --- a/lib/private/DB/AdapterPgSql.php +++ b/lib/private/DB/AdapterPgSql.php @@ -41,9 +41,6 @@ class AdapterPgSql extends Adapter { return $statement; } - /** - * @suppress SqlInjectionChecker - */ public function insertIgnoreConflict(string $table,array $values) : int { if ($this->isPre9_5CompatMode() === true) { return parent::insertIgnoreConflict($table, $values); diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index 3b24703d434..c5766dcd7e0 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -279,7 +279,6 @@ class Connection extends ReconnectWrapper implements IDBConnection { * @return int number of new rows * @throws \Doctrine\DBAL\DBALException * @throws PreConditionNotMetException - * @suppress SqlInjectionChecker */ public function setValues($table, array $keys, array $values, array $updatePreconditionValues = []) { try { diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 77289e674b3..8a173f35197 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -254,8 +254,6 @@ class Cache implements ICache { * * @return int file id * @throws \RuntimeException - * - * @suppress SqlInjectionChecker */ public function insert($file, array $data) { // normalize file @@ -613,7 +611,6 @@ class Cache implements ICache { * @param string $targetPath * @throws \OC\DatabaseException * @throws \Exception if the given storages have an invalid id - * @suppress SqlInjectionChecker */ public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) { if ($sourceCache instanceof Cache) { diff --git a/lib/private/Files/Cache/NullWatcher.php b/lib/private/Files/Cache/NullWatcher.php new file mode 100644 index 00000000000..57e43444fdc --- /dev/null +++ b/lib/private/Files/Cache/NullWatcher.php @@ -0,0 +1,53 @@ +<?php + +declare(strict_types=1); +/** + * @copyright Copyright (c) 2020 Robin Appelman <robin@icewind.nl> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OC\Files\Cache; + +class NullWatcher extends Watcher { + private $policy; + + public function __construct() { + } + + public function setPolicy($policy) { + $this->policy = $policy; + } + + public function getPolicy() { + return $this->policy; + } + + public function checkUpdate($path, $cachedEntry = null) { + return false; + } + + public function update($path, $cachedData) { + } + + public function needsUpdate($path, $cachedData) { + return false; + } + + public function cleanFolder($path) { + } +} diff --git a/lib/private/Files/Cache/Propagator.php b/lib/private/Files/Cache/Propagator.php index 92fa6436548..c9200d33b11 100644 --- a/lib/private/Files/Cache/Propagator.php +++ b/lib/private/Files/Cache/Propagator.php @@ -63,7 +63,6 @@ class Propagator implements IPropagator { * @param string $internalPath * @param int $time * @param int $sizeDifference number of bytes the file has grown - * @suppress SqlInjectionChecker */ public function propagateChange($internalPath, $time, $sizeDifference = 0) { // Do not propogate changes in ignored paths @@ -156,7 +155,6 @@ class Propagator implements IPropagator { /** * Commit the active propagation batch - * @suppress SqlInjectionChecker */ public function commitBatch() { if (!$this->inBatch) { diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 0dc3e5d4529..6fa9cd96bfe 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -375,7 +375,6 @@ class UserMountCache implements IUserMountCache { /** * @param array $users * @return array - * @suppress SqlInjectionChecker */ public function getUsedSpaceForUsers(array $users) { $builder = $this->connection->getQueryBuilder(); diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index c58387bbc2c..3a97764fbb8 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -263,7 +263,7 @@ class Encryption extends Wrapper { $encryptionModule = $this->getEncryptionModule($path); if ($encryptionModule) { - $this->keyStorage->deleteAllFileKeys($this->getFullPath($path)); + $this->keyStorage->deleteAllFileKeys($fullPath); } return $this->storage->unlink($path); diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index ef8656258d1..16074a89ca8 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -239,7 +239,7 @@ class View { public function getLocalFile($path) { $parent = substr($path, 0, strrpos($path, '/')); $path = $this->getAbsolutePath($path); - list($storage, $internalPath) = Filesystem::resolvePath($path); + [$storage, $internalPath] = Filesystem::resolvePath($path); if (Filesystem::isValidPath($parent) and $storage) { return $storage->getLocalFile($internalPath); } else { @@ -254,7 +254,7 @@ class View { public function getLocalFolder($path) { $parent = substr($path, 0, strrpos($path, '/')); $path = $this->getAbsolutePath($path); - list($storage, $internalPath) = Filesystem::resolvePath($path); + [$storage, $internalPath] = Filesystem::resolvePath($path); if (Filesystem::isValidPath($parent) and $storage) { return $storage->getLocalFolder($internalPath); } else { @@ -668,10 +668,10 @@ class View { $this->changeLock($path, ILockingProvider::LOCK_EXCLUSIVE); /** @var \OC\Files\Storage\Storage $storage */ - list($storage, $internalPath) = $this->resolvePath($path); + [$storage, $internalPath] = $this->resolvePath($path); $target = $storage->fopen($internalPath, 'w'); if ($target) { - list(, $result) = \OC_Helper::streamCopy($data, $target); + [, $result] = \OC_Helper::streamCopy($data, $target); fclose($target); fclose($data); @@ -1089,7 +1089,7 @@ class View { [Filesystem::signal_param_path => $this->getHookPath($path)] ); } - list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix); + [$storage, $internalPath] = Filesystem::resolvePath($absolutePath . $postFix); if ($storage) { return $storage->hash($type, $internalPath, $raw); } @@ -1143,7 +1143,7 @@ class View { $run = $this->runHooks($hooks, $path); /** @var \OC\Files\Storage\Storage $storage */ - list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix); + [$storage, $internalPath] = Filesystem::resolvePath($absolutePath . $postFix); if ($run and $storage) { if (in_array('write', $hooks) || in_array('delete', $hooks)) { try { @@ -1568,7 +1568,7 @@ class View { * @var \OC\Files\Storage\Storage $storage * @var string $internalPath */ - list($storage, $internalPath) = Filesystem::resolvePath($path); + [$storage, $internalPath] = Filesystem::resolvePath($path); if ($storage) { $cache = $storage->getCache($path); @@ -1705,7 +1705,7 @@ class View { * @var Storage\Storage $storage * @var string $internalPath */ - list($storage, $internalPath) = $this->resolvePath($path); + [$storage, $internalPath] = $this->resolvePath($path); if ($storage) { return $storage->getETag($internalPath); } else { @@ -1719,10 +1719,11 @@ class View { * Note that the resulting path is not guarantied to be unique for the id, multiple paths can point to the same file * * @param int $id - * @throws NotFoundException + * @param int|null $storageId * @return string + * @throws NotFoundException */ - public function getPath($id) { + public function getPath($id, int $storageId = null) { $id = (int)$id; $manager = Filesystem::getMountManager(); $mounts = $manager->findIn($this->fakeRoot); @@ -1737,6 +1738,12 @@ class View { return $a instanceof SharedMount && (!$b instanceof SharedMount) ? 1 : -1; }); + if (!is_null($storageId)) { + $mounts = array_filter($mounts, function (IMountPoint $mount) use ($storageId) { + return $mount->getNumericStorageId() === $storageId; + }); + } + foreach ($mounts as $mount) { /** * @var \OC\Files\Mount\MountPoint $mount @@ -1844,7 +1851,7 @@ class View { public function verifyPath($path, $fileName) { try { /** @type \OCP\Files\Storage $storage */ - list($storage, $internalPath) = $this->resolvePath($path); + [$storage, $internalPath] = $this->resolvePath($path); $storage->verifyPath($internalPath, $fileName); } catch (ReservedWordException $ex) { $l = \OC::$server->getL10N('lib'); diff --git a/lib/private/Group/MetaData.php b/lib/private/Group/MetaData.php index 21857b6c8f0..1bf748132fb 100644 --- a/lib/private/Group/MetaData.php +++ b/lib/private/Group/MetaData.php @@ -30,6 +30,7 @@ namespace OC\Group; +use OC\Group\Manager as GroupManager; use OCP\IGroupManager; use OCP\IUserSession; @@ -44,7 +45,7 @@ class MetaData { protected $isAdmin; /** @var array */ protected $metaData = []; - /** @var IGroupManager */ + /** @var GroupManager */ protected $groupManager; /** @var bool */ protected $sorting = false; @@ -55,7 +56,6 @@ class MetaData { * @param string $user the uid of the current user * @param bool $isAdmin whether the current users is an admin * @param IGroupManager $groupManager - * @param IUserManager $userManager * @param IUserSession $userSession */ public function __construct( diff --git a/lib/private/Lock/DBLockingProvider.php b/lib/private/Lock/DBLockingProvider.php index f48bf57028f..2ad7c162f36 100644 --- a/lib/private/Lock/DBLockingProvider.php +++ b/lib/private/Lock/DBLockingProvider.php @@ -216,8 +216,6 @@ class DBLockingProvider extends AbstractLockingProvider { /** * @param string $path * @param int $type self::LOCK_SHARED or self::LOCK_EXCLUSIVE - * - * @suppress SqlInjectionChecker */ public function releaseLock(string $path, int $type) { $this->markRelease($path, $type); @@ -288,8 +286,6 @@ class DBLockingProvider extends AbstractLockingProvider { /** * release all lock acquired by this instance which were marked using the mark* methods - * - * @suppress SqlInjectionChecker */ public function releaseAll() { parent::releaseAll(); diff --git a/lib/private/Repair/CleanTags.php b/lib/private/Repair/CleanTags.php index 959eb50e5a7..f414ef09efc 100644 --- a/lib/private/Repair/CleanTags.php +++ b/lib/private/Repair/CleanTags.php @@ -171,7 +171,6 @@ class CleanTags implements IRepairStep { * @param string $sourceId * @param string $sourceNullColumn If this column is null in the source table, * the entry is deleted in the $deleteTable - * @suppress SqlInjectionChecker */ protected function deleteOrphanEntries(IOutput $output, $repairInfo, $deleteTable, $deleteId, $sourceTable, $sourceId, $sourceNullColumn) { $qb = $this->connection->getQueryBuilder(); diff --git a/lib/private/Repair/OldGroupMembershipShares.php b/lib/private/Repair/OldGroupMembershipShares.php index 2b2fd9cd470..38254188221 100644 --- a/lib/private/Repair/OldGroupMembershipShares.php +++ b/lib/private/Repair/OldGroupMembershipShares.php @@ -66,7 +66,6 @@ class OldGroupMembershipShares implements IRepairStep { * Must throw exception on error. * * @throws \Exception in case of failure - * @suppress SqlInjectionChecker */ public function run(IOutput $output) { $deletedEntries = 0; diff --git a/lib/private/Repair/RepairInvalidShares.php b/lib/private/Repair/RepairInvalidShares.php index 27defdeda01..1fc98a1d466 100644 --- a/lib/private/Repair/RepairInvalidShares.php +++ b/lib/private/Repair/RepairInvalidShares.php @@ -56,7 +56,6 @@ class RepairInvalidShares implements IRepairStep { /** * Adjust file share permissions - * @suppress SqlInjectionChecker */ private function adjustFileSharePermissions(IOutput $out) { $mask = \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_SHARE; diff --git a/lib/private/Security/Bruteforce/Throttler.php b/lib/private/Security/Bruteforce/Throttler.php index 61e18088e94..01c0e02ef8f 100644 --- a/lib/private/Security/Bruteforce/Throttler.php +++ b/lib/private/Security/Bruteforce/Throttler.php @@ -115,7 +115,6 @@ class Throttler { * @param string $action * @param string $ip * @param array $metadata Optional metadata logged to the database - * @suppress SqlInjectionChecker */ public function registerAttempt(string $action, string $ip, diff --git a/lib/private/Server.php b/lib/private/Server.php index d39ed45b6c2..884e1eab3c6 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -1332,7 +1332,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Calendar\IManager - * @deprecated + * @deprecated 20.0.0 */ public function getCalendarManager() { return $this->query(\OC\Calendar\Manager::class); @@ -1340,7 +1340,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Calendar\Resource\IManager - * @deprecated + * @deprecated 20.0.0 */ public function getCalendarResourceBackendManager() { return $this->query(\OC\Calendar\Resource\Manager::class); @@ -1348,7 +1348,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Calendar\Room\IManager - * @deprecated + * @deprecated 20.0.0 */ public function getCalendarRoomBackendManager() { return $this->query(\OC\Calendar\Room\Manager::class); @@ -1404,7 +1404,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Contacts\IManager - * @deprecated + * @deprecated 20.0.0 */ public function getContactsManager() { return $this->query(\OCP\Contacts\IManager::class); @@ -1412,7 +1412,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OC\Encryption\Manager - * @deprecated + * @deprecated 20.0.0 */ public function getEncryptionManager() { return $this->query(\OCP\Encryption\IManager::class); @@ -1420,7 +1420,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OC\Encryption\File - * @deprecated + * @deprecated 20.0.0 */ public function getEncryptionFilesHelper() { return $this->query('EncryptionFileHelper'); @@ -1428,7 +1428,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Encryption\Keys\IStorage - * @deprecated + * @deprecated 20.0.0 */ public function getEncryptionKeyStorage() { return $this->query('EncryptionKeyStorage'); @@ -1440,7 +1440,7 @@ class Server extends ServerContainer implements IServerContainer { * In case the current execution was not initiated by a web request null is returned * * @return \OCP\IRequest - * @deprecated + * @deprecated 20.0.0 */ public function getRequest() { return $this->query(IRequest::class); @@ -1450,7 +1450,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns the preview manager which can create preview images for a given file * * @return IPreview - * @deprecated + * @deprecated 20.0.0 */ public function getPreviewManager() { return $this->query(IPreview::class); @@ -1461,7 +1461,7 @@ class Server extends ServerContainer implements IServerContainer { * * @see \OCP\ITagManager::load() * @return ITagManager - * @deprecated + * @deprecated 20.0.0 */ public function getTagManager() { return $this->query(ITagManager::class); @@ -1473,7 +1473,7 @@ class Server extends ServerContainer implements IServerContainer { * @return ISystemTagManager * * @since 9.0.0 - * @deprecated + * @deprecated 20.0.0 */ public function getSystemTagManager() { return $this->query(ISystemTagManager::class); @@ -1485,7 +1485,7 @@ class Server extends ServerContainer implements IServerContainer { * @return ISystemTagObjectMapper * * @since 9.0.0 - * @deprecated + * @deprecated 20.0.0 */ public function getSystemTagObjectMapper() { return $this->query(ISystemTagObjectMapper::class); @@ -1495,7 +1495,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns the avatar manager, used for avatar functionality * * @return IAvatarManager - * @deprecated + * @deprecated 20.0.0 */ public function getAvatarManager() { return $this->query(IAvatarManager::class); @@ -1505,7 +1505,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns the root folder of ownCloud's data directory * * @return IRootFolder - * @deprecated + * @deprecated 20.0.0 */ public function getRootFolder() { return $this->query(IRootFolder::class); @@ -1517,6 +1517,7 @@ class Server extends ServerContainer implements IServerContainer { * is actually used. * * @return IRootFolder + * @deprecated 20.0.0 */ public function getLazyRootFolder() { return $this->query(IRootFolder::class); @@ -1527,7 +1528,7 @@ class Server extends ServerContainer implements IServerContainer { * * @param string $userId user ID * @return \OCP\Files\Folder|null - * @deprecated + * @deprecated 20.0.0 */ public function getUserFolder($userId = null) { if ($userId === null) { @@ -1543,7 +1544,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OC\User\Manager - * @deprecated + * @deprecated 20.0.0 */ public function getUserManager() { return $this->query(IUserManager::class); @@ -1551,7 +1552,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OC\Group\Manager - * @deprecated + * @deprecated 20.0.0 */ public function getGroupManager() { return $this->query(IGroupManager::class); @@ -1559,7 +1560,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OC\User\Session - * @deprecated + * @deprecated 20.0.0 */ public function getUserSession() { return $this->query(IUserSession::class); @@ -1567,7 +1568,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\ISession - * @deprecated + * @deprecated 20.0.0 */ public function getSession() { return $this->getUserSession()->getSession(); @@ -1584,7 +1585,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OC\Authentication\TwoFactorAuth\Manager - * @deprecated + * @deprecated 20.0.0 */ public function getTwoFactorAuthManager() { return $this->query(\OC\Authentication\TwoFactorAuth\Manager::class); @@ -1592,7 +1593,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OC\NavigationManager - * @deprecated + * @deprecated 20.0.0 */ public function getNavigationManager() { return $this->query(INavigationManager::class); @@ -1600,7 +1601,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\IConfig - * @deprecated + * @deprecated 20.0.0 */ public function getConfig() { return $this->query(AllConfig::class); @@ -1608,7 +1609,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OC\SystemConfig - * @deprecated + * @deprecated 20.0.0 */ public function getSystemConfig() { return $this->query(SystemConfig::class); @@ -1618,7 +1619,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns the app config manager * * @return IAppConfig - * @deprecated + * @deprecated 20.0.0 */ public function getAppConfig() { return $this->query(IAppConfig::class); @@ -1626,7 +1627,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return IFactory - * @deprecated + * @deprecated 20.0.0 */ public function getL10NFactory() { return $this->query(IFactory::class); @@ -1638,7 +1639,7 @@ class Server extends ServerContainer implements IServerContainer { * @param string $app appid * @param string $lang * @return IL10N - * @deprecated + * @deprecated 20.0.0 */ public function getL10N($app, $lang = null) { return $this->getL10NFactory()->get($app, $lang); @@ -1646,7 +1647,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return IURLGenerator - * @deprecated + * @deprecated 20.0.0 */ public function getURLGenerator() { return $this->query(IURLGenerator::class); @@ -1654,7 +1655,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return AppFetcher - * @deprecated + * @deprecated 20.0.0 */ public function getAppFetcher() { return $this->query(AppFetcher::class); @@ -1675,7 +1676,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns an \OCP\CacheFactory instance * * @return \OCP\ICacheFactory - * @deprecated + * @deprecated 20.0.0 */ public function getMemCacheFactory() { return $this->query(Factory::class); @@ -1685,7 +1686,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns an \OC\RedisFactory instance * * @return \OC\RedisFactory - * @deprecated + * @deprecated 20.0.0 */ public function getGetRedisFactory() { return $this->query('RedisFactory'); @@ -1696,7 +1697,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns the current session * * @return \OCP\IDBConnection - * @deprecated + * @deprecated 20.0.0 */ public function getDatabaseConnection() { return $this->query(IDBConnection::class); @@ -1706,7 +1707,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns the activity manager * * @return \OCP\Activity\IManager - * @deprecated + * @deprecated 20.0.0 */ public function getActivityManager() { return $this->query(\OCP\Activity\IManager::class); @@ -1716,7 +1717,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns an job list for controlling background jobs * * @return IJobList - * @deprecated + * @deprecated 20.0.0 */ public function getJobList() { return $this->query(IJobList::class); @@ -1726,7 +1727,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns a logger instance * * @return ILogger - * @deprecated + * @deprecated 20.0.0 */ public function getLogger() { return $this->query(ILogger::class); @@ -1735,7 +1736,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return ILogFactory * @throws \OCP\AppFramework\QueryException - * @deprecated + * @deprecated 20.0.0 */ public function getLogFactory() { return $this->query(ILogFactory::class); @@ -1745,7 +1746,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns a router for generating and matching urls * * @return IRouter - * @deprecated + * @deprecated 20.0.0 */ public function getRouter() { return $this->query(IRouter::class); @@ -1755,7 +1756,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns a search instance * * @return ISearch - * @deprecated + * @deprecated 20.0.0 */ public function getSearch() { return $this->query(ISearch::class); @@ -1765,7 +1766,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns a SecureRandom instance * * @return \OCP\Security\ISecureRandom - * @deprecated + * @deprecated 20.0.0 */ public function getSecureRandom() { return $this->query(ISecureRandom::class); @@ -1775,7 +1776,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns a Crypto instance * * @return ICrypto - * @deprecated + * @deprecated 20.0.0 */ public function getCrypto() { return $this->query(ICrypto::class); @@ -1785,7 +1786,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns a Hasher instance * * @return IHasher - * @deprecated + * @deprecated 20.0.0 */ public function getHasher() { return $this->query(IHasher::class); @@ -1795,7 +1796,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns a CredentialsManager instance * * @return ICredentialsManager - * @deprecated + * @deprecated 20.0.0 */ public function getCredentialsManager() { return $this->query(ICredentialsManager::class); @@ -1806,7 +1807,7 @@ class Server extends ServerContainer implements IServerContainer { * * @param string $userId (optional) if not specified the current loggedin user is used, use null to get the system certificate manager * @return \OCP\ICertificateManager | null if $uid is null and no user is logged in - * @deprecated + * @deprecated 20.0.0 */ public function getCertificateManager($userId = '') { if ($userId === '') { @@ -1830,7 +1831,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns an instance of the HTTP client service * * @return IClientService - * @deprecated + * @deprecated 20.0.0 */ public function getHTTPClientService() { return $this->query(IClientService::class); @@ -1840,7 +1841,7 @@ class Server extends ServerContainer implements IServerContainer { * Create a new event source * * @return \OCP\IEventSource - * @deprecated + * @deprecated 20.0.0 */ public function createEventSource() { return new \OC_EventSource(); @@ -1852,7 +1853,7 @@ class Server extends ServerContainer implements IServerContainer { * The returned logger only logs data when debug mode is enabled * * @return IEventLogger - * @deprecated + * @deprecated 20.0.0 */ public function getEventLogger() { return $this->query(IEventLogger::class); @@ -1864,7 +1865,7 @@ class Server extends ServerContainer implements IServerContainer { * The returned logger only logs data when debug mode is enabled * * @return IQueryLogger - * @deprecated + * @deprecated 20.0.0 */ public function getQueryLogger() { return $this->query(IQueryLogger::class); @@ -1874,7 +1875,7 @@ class Server extends ServerContainer implements IServerContainer { * Get the manager for temporary files and folders * * @return \OCP\ITempManager - * @deprecated + * @deprecated 20.0.0 */ public function getTempManager() { return $this->query(ITempManager::class); @@ -1884,7 +1885,7 @@ class Server extends ServerContainer implements IServerContainer { * Get the app manager * * @return \OCP\App\IAppManager - * @deprecated + * @deprecated 20.0.0 */ public function getAppManager() { return $this->query(IAppManager::class); @@ -1894,7 +1895,7 @@ class Server extends ServerContainer implements IServerContainer { * Creates a new mailer * * @return IMailer - * @deprecated + * @deprecated 20.0.0 */ public function getMailer() { return $this->query(IMailer::class); @@ -1904,7 +1905,7 @@ class Server extends ServerContainer implements IServerContainer { * Get the webroot * * @return string - * @deprecated + * @deprecated 20.0.0 */ public function getWebRoot() { return $this->webRoot; @@ -1912,7 +1913,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OC\OCSClient - * @deprecated + * @deprecated 20.0.0 */ public function getOcsClient() { return $this->query('OcsClient'); @@ -1920,7 +1921,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return IDateTimeZone - * @deprecated + * @deprecated 20.0.0 */ public function getDateTimeZone() { return $this->query(IDateTimeZone::class); @@ -1928,7 +1929,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return IDateTimeFormatter - * @deprecated + * @deprecated 20.0.0 */ public function getDateTimeFormatter() { return $this->query(IDateTimeFormatter::class); @@ -1936,7 +1937,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return IMountProviderCollection - * @deprecated + * @deprecated 20.0.0 */ public function getMountProviderCollection() { return $this->query(IMountProviderCollection::class); @@ -1946,7 +1947,7 @@ class Server extends ServerContainer implements IServerContainer { * Get the IniWrapper * * @return IniGetWrapper - * @deprecated + * @deprecated 20.0.0 */ public function getIniWrapper() { return $this->query(IniGetWrapper::class); @@ -1954,7 +1955,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Command\IBus - * @deprecated + * @deprecated 20.0.0 */ public function getCommandBus() { return $this->query('AsyncCommandBus'); @@ -1964,7 +1965,7 @@ class Server extends ServerContainer implements IServerContainer { * Get the trusted domain helper * * @return TrustedDomainHelper - * @deprecated + * @deprecated 20.0.0 */ public function getTrustedDomainHelper() { return $this->query(TrustedDomainHelper::class); @@ -1975,7 +1976,7 @@ class Server extends ServerContainer implements IServerContainer { * * @return ILockingProvider * @since 8.1.0 - * @deprecated + * @deprecated 20.0.0 */ public function getLockingProvider() { return $this->query(ILockingProvider::class); @@ -1983,7 +1984,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return IMountManager - * @deprecated + * @deprecated 20.0.0 **/ public function getMountManager() { return $this->query(IMountManager::class); @@ -1991,7 +1992,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return IUserMountCache - * @deprecated + * @deprecated 20.0.0 */ public function getUserMountCache() { return $this->query(IUserMountCache::class); @@ -2001,7 +2002,7 @@ class Server extends ServerContainer implements IServerContainer { * Get the MimeTypeDetector * * @return IMimeTypeDetector - * @deprecated + * @deprecated 20.0.0 */ public function getMimeTypeDetector() { return $this->query(IMimeTypeDetector::class); @@ -2011,7 +2012,7 @@ class Server extends ServerContainer implements IServerContainer { * Get the MimeTypeLoader * * @return IMimeTypeLoader - * @deprecated + * @deprecated 20.0.0 */ public function getMimeTypeLoader() { return $this->query(IMimeTypeLoader::class); @@ -2021,7 +2022,7 @@ class Server extends ServerContainer implements IServerContainer { * Get the manager of all the capabilities * * @return CapabilitiesManager - * @deprecated + * @deprecated 20.0.0 */ public function getCapabilitiesManager() { return $this->query(CapabilitiesManager::class); @@ -2043,7 +2044,7 @@ class Server extends ServerContainer implements IServerContainer { * * @return \OCP\Notification\IManager * @since 8.2.0 - * @deprecated + * @deprecated 20.0.0 */ public function getNotificationManager() { return $this->query(\OCP\Notification\IManager::class); @@ -2051,7 +2052,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return ICommentsManager - * @deprecated + * @deprecated 20.0.0 */ public function getCommentsManager() { return $this->query(ICommentsManager::class); @@ -2059,7 +2060,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCA\Theming\ThemingDefaults - * @deprecated + * @deprecated 20.0.0 */ public function getThemingDefaults() { return $this->query('ThemingDefaults'); @@ -2067,7 +2068,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OC\IntegrityCheck\Checker - * @deprecated + * @deprecated 20.0.0 */ public function getIntegrityCodeChecker() { return $this->query('IntegrityCodeChecker'); @@ -2075,7 +2076,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OC\Session\CryptoWrapper - * @deprecated + * @deprecated 20.0.0 */ public function getSessionCryptoWrapper() { return $this->query('CryptoWrapper'); @@ -2083,7 +2084,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return CsrfTokenManager - * @deprecated + * @deprecated 20.0.0 */ public function getCsrfTokenManager() { return $this->query(CsrfTokenManager::class); @@ -2091,7 +2092,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return Throttler - * @deprecated + * @deprecated 20.0.0 */ public function getBruteForceThrottler() { return $this->query(Throttler::class); @@ -2099,7 +2100,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return IContentSecurityPolicyManager - * @deprecated + * @deprecated 20.0.0 */ public function getContentSecurityPolicyManager() { return $this->query(ContentSecurityPolicyManager::class); @@ -2107,7 +2108,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return ContentSecurityPolicyNonceManager - * @deprecated + * @deprecated 20.0.0 */ public function getContentSecurityPolicyNonceManager() { return $this->query(ContentSecurityPolicyNonceManager::class); @@ -2117,7 +2118,7 @@ class Server extends ServerContainer implements IServerContainer { * Not a public API as of 8.2, wait for 9.0 * * @return \OCA\Files_External\Service\BackendService - * @deprecated + * @deprecated 20.0.0 */ public function getStoragesBackendService() { return $this->query(BackendService::class); @@ -2127,7 +2128,7 @@ class Server extends ServerContainer implements IServerContainer { * Not a public API as of 8.2, wait for 9.0 * * @return \OCA\Files_External\Service\GlobalStoragesService - * @deprecated + * @deprecated 20.0.0 */ public function getGlobalStoragesService() { return $this->query(GlobalStoragesService::class); @@ -2137,7 +2138,7 @@ class Server extends ServerContainer implements IServerContainer { * Not a public API as of 8.2, wait for 9.0 * * @return \OCA\Files_External\Service\UserGlobalStoragesService - * @deprecated + * @deprecated 20.0.0 */ public function getUserGlobalStoragesService() { return $this->query(UserGlobalStoragesService::class); @@ -2147,7 +2148,7 @@ class Server extends ServerContainer implements IServerContainer { * Not a public API as of 8.2, wait for 9.0 * * @return \OCA\Files_External\Service\UserStoragesService - * @deprecated + * @deprecated 20.0.0 */ public function getUserStoragesService() { return $this->query(UserStoragesService::class); @@ -2155,7 +2156,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Share\IManager - * @deprecated + * @deprecated 20.0.0 */ public function getShareManager() { return $this->query(\OCP\Share\IManager::class); @@ -2163,7 +2164,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Collaboration\Collaborators\ISearch - * @deprecated + * @deprecated 20.0.0 */ public function getCollaboratorSearch() { return $this->query(\OCP\Collaboration\Collaborators\ISearch::class); @@ -2171,7 +2172,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Collaboration\AutoComplete\IManager - * @deprecated + * @deprecated 20.0.0 */ public function getAutoCompleteManager() { return $this->query(IManager::class); @@ -2181,7 +2182,7 @@ class Server extends ServerContainer implements IServerContainer { * Returns the LDAP Provider * * @return \OCP\LDAP\ILDAPProvider - * @deprecated + * @deprecated 20.0.0 */ public function getLDAPProvider() { return $this->query('LDAPProvider'); @@ -2189,7 +2190,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Settings\IManager - * @deprecated + * @deprecated 20.0.0 */ public function getSettingsManager() { return $this->query(\OC\Settings\Manager::class); @@ -2197,7 +2198,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Files\IAppData - * @deprecated + * @deprecated 20.0.0 */ public function getAppDataDir($app) { /** @var \OC\Files\AppData\Factory $factory */ @@ -2207,7 +2208,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Lockdown\ILockdownManager - * @deprecated + * @deprecated 20.0.0 */ public function getLockdownManager() { return $this->query('LockdownManager'); @@ -2215,7 +2216,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Federation\ICloudIdManager - * @deprecated + * @deprecated 20.0.0 */ public function getCloudIdManager() { return $this->query(ICloudIdManager::class); @@ -2223,7 +2224,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\GlobalScale\IConfig - * @deprecated + * @deprecated 20.0.0 */ public function getGlobalScaleConfig() { return $this->query(IConfig::class); @@ -2231,7 +2232,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Federation\ICloudFederationProviderManager - * @deprecated + * @deprecated 20.0.0 */ public function getCloudFederationProviderManager() { return $this->query(ICloudFederationProviderManager::class); @@ -2239,7 +2240,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Remote\Api\IApiFactory - * @deprecated + * @deprecated 20.0.0 */ public function getRemoteApiFactory() { return $this->query(IApiFactory::class); @@ -2247,7 +2248,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Federation\ICloudFederationFactory - * @deprecated + * @deprecated 20.0.0 */ public function getCloudFederationFactory() { return $this->query(ICloudFederationFactory::class); @@ -2255,7 +2256,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Remote\IInstanceFactory - * @deprecated + * @deprecated 20.0.0 */ public function getRemoteInstanceFactory() { return $this->query(IInstanceFactory::class); @@ -2263,7 +2264,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return IStorageFactory - * @deprecated + * @deprecated 20.0.0 */ public function getStorageFactory() { return $this->query(IStorageFactory::class); @@ -2274,7 +2275,7 @@ class Server extends ServerContainer implements IServerContainer { * * @return GeneratorHelper * @since 17.0.0 - * @deprecated + * @deprecated 20.0.0 */ public function getGeneratorHelper() { return $this->query(\OC\Preview\GeneratorHelper::class); diff --git a/lib/private/Setup/PostgreSQL.php b/lib/private/Setup/PostgreSQL.php index 17ae991a1de..3d7a0b2a4b1 100644 --- a/lib/private/Setup/PostgreSQL.php +++ b/lib/private/Setup/PostgreSQL.php @@ -39,7 +39,6 @@ class PostgreSQL extends AbstractDatabase { /** * @param string $username * @throws \OC\DatabaseSetupException - * @suppress SqlInjectionChecker */ public function setupDatabase($username) { try { diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index ebbe92e7875..f6009c5de87 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -106,7 +106,6 @@ abstract class QBMapper { * @param Entity $entity the entity that should be created * @return Entity the saved entity with the set id * @since 14.0.0 - * @suppress SqlInjectionChecker */ public function insert(Entity $entity): Entity { // get updated fields to save, fields have to be set using a setter to @@ -145,7 +144,6 @@ abstract class QBMapper { * @return Entity the saved entity with the (new) id * @throws \InvalidArgumentException if entity has no id * @since 15.0.0 - * @suppress SqlInjectionChecker */ public function insertOrUpdate(Entity $entity): Entity { try { @@ -161,7 +159,6 @@ abstract class QBMapper { * @param Entity $entity the entity that should be created * @return Entity the saved entity with the set id * @since 14.0.0 - * @suppress SqlInjectionChecker */ public function update(Entity $entity): Entity { // if entity wasn't changed it makes no sense to run a db query |