fix: Also remove digits at the start and underscore on both ends of appid

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
This commit is contained in:
Côme Chilliet 2025-02-13 16:22:21 +01:00 committed by GitHub
parent 8f57a50767
commit 6e7c97ea1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}
}