aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/App
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-09-12 16:17:19 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-09-13 10:08:43 +0200
commit7ed583cb8ee64f77696b0e23f79d8d1b4038bcbc (patch)
treed6c7117c08cd346c300fab6f8de9baedcbaca8a8 /lib/private/App
parentc9e4598360335d7eab0f4a5153dbf16a1f161351 (diff)
downloadnextcloud-server-7ed583cb8ee64f77696b0e23f79d8d1b4038bcbc.tar.gz
nextcloud-server-7ed583cb8ee64f77696b0e23f79d8d1b4038bcbc.zip
chore: Migrate cleanAppId and getAppPath calls to IAppManager from OC_App
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/App')
-rw-r--r--lib/private/App/AppManager.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php
index fe2f7b74b22..974545cfe92 100644
--- a/lib/private/App/AppManager.php
+++ b/lib/private/App/AppManager.php
@@ -647,11 +647,9 @@ class AppManager implements IAppManager {
/**
* Get the directory for the given app.
*
- * @param string $appId
- * @return string
* @throws AppPathNotFoundException if app folder can't be found
*/
- public function getAppPath($appId) {
+ public function getAppPath(string $appId): string {
$appPath = \OC_App::getAppPath($appId);
if ($appPath === false) {
throw new AppPathNotFoundException('Could not find path for ' . $appId);
@@ -877,4 +875,9 @@ class AppManager implements IAppManager {
return false;
}
+
+ public function cleanAppId(string $app): string {
+ // FIXME should list allowed characters instead
+ return str_replace(['<', '>', '"', "'", '\0', '/', '\\', '..'], '', $app);
+ }
}