1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2026-05-16 20:41:55 +00:00

Improve template URI escaping and parameter handling

This commit is contained in:
FreddleSpl0it
2026-03-19 12:48:43 +01:00
parent 95bf46c1e4
commit 8c039f694f
3 changed files with 5 additions and 3 deletions

View File

@@ -13,7 +13,9 @@ $twig = new Environment($loader, [
// functions
$twig->addFunction(new TwigFunction('query_string', function (array $params = []) {
return http_build_query(array_merge($_GET, $params));
$allowed = ['lang', 'mobileconfig'];
$filtered = array_intersect_key($_GET, array_flip($allowed));
return http_build_query(array_merge($filtered, $params));
}));
$twig->addFunction(new TwigFunction('is_uri', function (string $uri, string $where = null) {