From 6e7c97ea1f6a8998249ef7365b3e67260ba72441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <91878298+come-nc@users.noreply.github.com> Date: Thu, 13 Feb 2025 16:22:21 +0100 Subject: [PATCH] fix: Also remove digits at the start and underscore on both ends of appid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ferdinand Thiessen Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com> --- lib/private/App/AppManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } }