diff --git a/lib/private/CapabilitiesManager.php b/lib/private/CapabilitiesManager.php index d7bf25f078ac0..07076d9aacd80 100644 --- a/lib/private/CapabilitiesManager.php +++ b/lib/private/CapabilitiesManager.php @@ -32,7 +32,7 @@ public function __construct(LoggerInterface $logger) { } /** - * Get an array of al the capabilities that are registered at this manager + * Get an array of all the capabilities that are registered at this manager * * @param bool $public get public capabilities only * @throws \InvalidArgumentException diff --git a/lib/private/OCS/CoreCapabilities.php b/lib/private/OCS/CoreCapabilities.php index 3d988a8662e76..f67d853dd5dc1 100644 --- a/lib/private/OCS/CoreCapabilities.php +++ b/lib/private/OCS/CoreCapabilities.php @@ -8,6 +8,7 @@ namespace OC\OCS; use OCP\Capabilities\ICapability; +use OCP\Conversion\IConversionManager; use OCP\IConfig; use OCP\IURLGenerator; @@ -22,6 +23,7 @@ class CoreCapabilities implements ICapability { */ public function __construct( private IConfig $config, + private IConversionManager $conversionManager, ) { } @@ -34,6 +36,7 @@ public function __construct( * webdav-root: string, * reference-api: boolean, * reference-regex: string, + * conversions: array>, * mod-rewrite-working: boolean, * }, * } @@ -45,6 +48,7 @@ public function getCapabilities(): array { 'webdav-root' => $this->config->getSystemValueString('webdav-root', 'remote.php/webdav'), 'reference-api' => true, 'reference-regex' => IURLGenerator::URL_REGEX_NO_MODIFIERS, + 'conversions' => array_merge([], ...$this->conversionManager->getMimeTypes()), 'mod-rewrite-working' => $this->config->getSystemValueBool('htaccess.IgnoreFrontController') || getenv('front_controller_active') === 'true', ], ]; diff --git a/lib/private/Server.php b/lib/private/Server.php index 9f38477be0cb3..99bfe14b08440 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -1008,7 +1008,10 @@ public function __construct($webRoot, \OC\Config $config) { $this->registerService(CapabilitiesManager::class, function (ContainerInterface $c) { $manager = new CapabilitiesManager($c->get(LoggerInterface::class)); $manager->registerCapability(function () use ($c) { - return new \OC\OCS\CoreCapabilities($c->get(\OCP\IConfig::class)); + return new \OC\OCS\CoreCapabilities( + $c->get(\OCP\IConfig::class), + $c->get(\OCP\Conversion\IConversionManager::class) + ); }); $manager->registerCapability(function () use ($c) { return $c->get(\OC\Security\Bruteforce\Capabilities::class);