Refactor string concatenation and update function signatures for improved readability and null handling in shared helper functions

This commit is contained in:
Andras Bacsai
2024-12-03 15:39:24 +01:00
parent ec9315f24e
commit 74311f4feb

View File

@@ -90,8 +90,11 @@ function metrics_dir(): string
return base_configuration_dir().'/metrics'; return base_configuration_dir().'/metrics';
} }
function sanitize_string(string $input): string function sanitize_string(?string $input = null): ?string
{ {
if (is_null($input)) {
return null;
}
// Remove any HTML/PHP tags // Remove any HTML/PHP tags
$sanitized = strip_tags($input); $sanitized = strip_tags($input);