From c0aedd04d52a221e3a2ad4882e893630d0f68e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Sun, 29 Dec 2019 18:46:34 +0100 Subject: [PATCH] core: mark dbpath as safe for Postfix maps When tests are using SQLite as database backend, the database name can contain '&' which is escaped if `dbname` is unsafe. --- modoboa/core/management/commands/generate_postfix_maps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modoboa/core/management/commands/generate_postfix_maps.py b/modoboa/core/management/commands/generate_postfix_maps.py index 474a2f6a8..b76fb289b 100644 --- a/modoboa/core/management/commands/generate_postfix_maps.py +++ b/modoboa/core/management/commands/generate_postfix_maps.py @@ -79,7 +79,7 @@ class Command(BaseCommand): """Return map file template.""" tplcontent = MAP_FILE_TEMPLATE if dbtype == "sqlite": - tplcontent += """dbpath = {{ dbname }} + tplcontent += """dbpath = {{ dbname|safe }} query = {{ query|safe }} """ else: