From 7ed583cb8ee64f77696b0e23f79d8d1b4038bcbc Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Thu, 12 Sep 2024 16:17:19 +0200 Subject: chore: Migrate cleanAppId and getAppPath calls to IAppManager from OC_App MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/provisioning_api/lib/Controller/AppConfigController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'apps/provisioning_api/lib') diff --git a/apps/provisioning_api/lib/Controller/AppConfigController.php b/apps/provisioning_api/lib/Controller/AppConfigController.php index 5061a0ffc8f..bb161f6cb8c 100644 --- a/apps/provisioning_api/lib/Controller/AppConfigController.php +++ b/apps/provisioning_api/lib/Controller/AppConfigController.php @@ -10,6 +10,7 @@ namespace OCA\Provisioning_API\Controller; use OC\AppConfig; use OC\AppFramework\Middleware\Security\Exceptions\NotAdminException; +use OCP\App\IAppManager; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired; @@ -35,6 +36,7 @@ class AppConfigController extends OCSController { private IL10N $l10n, private IGroupManager $groupManager, private IManager $settingManager, + private IAppManager $appManager, ) { parent::__construct($appName, $request); } @@ -171,11 +173,10 @@ class AppConfigController extends OCSController { } /** - * @param string $app * @throws \InvalidArgumentException */ - protected function verifyAppId(string $app) { - if (\OC_App::cleanAppId($app) !== $app) { + protected function verifyAppId(string $app): void { + if ($this->appManager->cleanAppId($app) !== $app) { throw new \InvalidArgumentException('Invalid app id given'); } } -- cgit v1.2.3