diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 8137805ac3488..655d80e9b6c91 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -1031,7 +1031,13 @@ public function isBackendRequired(string $backend): bool { */ public function cleanAppId(string $app): string { /* Only lowercase alphanumeric is allowed */ - return preg_replace('/(^[0-9_-]+|[^a-z0-9_-]+|[_-]+$)/', '', $app); + $cleanAppId = preg_replace('/(^[0-9_-]+|[^a-z0-9_-]+|[_-]+$)/', '', $app, -1, $count); + if ($count > 0) { + $this->logger->debug('Only lowercase alphanumeric characters are allowed in appIds; check paths of installed app [' . $count . ' characters replaced]', [ + 'app' => $cleanAppId, // safer to log $cleanAppId even if it makes more challenging to troubleshooting (part of why character count is at least logged) + ]); + } + return $cleanAppId; } /**