From a9ad23e3d8ffa974c34d5312ee2f1ccba3adc1ff 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 3f2e31f08ee..12282af0873 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -943,6 +943,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); } }