aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2025-02-13 16:22:21 +0100
committerGitHub <noreply@github.com>2025-02-13 16:22:21 +0100
commit6e7c97ea1f6a8998249ef7365b3e67260ba72441 (patch)
tree64c815943c788ffdd9c2d31f557dccf1ecb365d6
parent8f57a5076717280b2450ba2737d0c214bf45b314 (diff)
downloadnextcloud-server-fix/fix-appmanager-cleanappid.tar.gz
nextcloud-server-fix/fix-appmanager-cleanappid.zip
fix: Also remove digits at the start and underscore on both ends of appidfix/fix-appmanager-cleanappid
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de> Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
-rw-r--r--lib/private/App/AppManager.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php
index 544b304b9bd..067cc89d674 100644
--- a/lib/private/App/AppManager.php
+++ b/lib/private/App/AppManager.php
@@ -956,6 +956,6 @@ class AppManager implements IAppManager {
*/
public function cleanAppId(string $app): string {
/* Only lowercase alphanumeric is allowed */
- return preg_replace('/[^a-z0-9_]+/', '', $app);
+ return preg_replace('/(^[0-9_]|[^a-z0-9_]+|_$)/', '', $app);
}
}