Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Merge branch 'next' into main

Marvin von Rappardf7eccefda3bc
diff --cc bootstrap/helpers/shared.php
index f09255ea04,a3ef93dfc3..40c5acb217
--- a/bootstrap/helpers/shared.php
+++ b/bootstrap/helpers/shared.php
@@@ -88,11 -87,34 +88,34 @@@ function backup_dir(): strin
}
function metrics_dir(): string
{
- return base_configuration_dir().'/metrics';
+ return base_configuration_dir() . '/metrics';
}
+ function sanitize_string(?string $input = null): ?string
+ {
+ if (is_null($input)) {
+ return null;
+ }
+ // Remove any HTML/PHP tags
+ $sanitized = strip_tags($input);
+
+ // Convert special characters to HTML entities
+ $sanitized = htmlspecialchars($sanitized, ENT_QUOTES | ENT_HTML5, 'UTF-8');
+
+ // Remove any control characters
+ $sanitized = preg_replace('/[\x00-\x1F\x7F]/u', '', $sanitized);
+
+ // Trim whitespace
+ $sanitized = trim($sanitized);
+
+ return $sanitized;
+ }
+
function generate_readme_file(string $name, string $updated_at): string
{
+ $name = sanitize_string($name);
+ $updated_at = sanitize_string($updated_at);
+
return "Resource name: $name\nLatest Deployment Date: $updated_at";
}