summary refs log tree commit diff
path: root/synapse/config/_base.py
diff options
context:
space:
mode:
authorBen Banfield-Zanin <benbz@matrix.org>2020-09-28 15:34:16 +0100
committerBen Banfield-Zanin <benbz@matrix.org>2020-09-28 15:34:16 +0100
commit1fa060e8de625ee9a9c8ab24027701be5d511300 (patch)
tree1ff1431a26f61893a32d02b7df7da75721d7d090 /synapse/config/_base.py
parentMerge remote-tracking branch 'origin/release-v1.20.0' into bbz/info-mainline-... (diff)
parents/URLs/variables in changelog (diff)
downloadsynapse-1fa060e8de625ee9a9c8ab24027701be5d511300.tar.xz
Merge remote-tracking branch 'origin/release-v1.20.1' into bbz/info-mainline-1.20.1
Diffstat (limited to 'synapse/config/_base.py')
-rw-r--r--synapse/config/_base.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/config/_base.py b/synapse/config/_base.py

index ad5ab6ad62..f8ab8e38df 100644 --- a/synapse/config/_base.py +++ b/synapse/config/_base.py
@@ -194,7 +194,10 @@ class Config: return file_stream.read() def read_templates( - self, filenames: List[str], custom_template_directory: Optional[str] = None, + self, + filenames: List[str], + custom_template_directory: Optional[str] = None, + autoescape: bool = False, ) -> List[jinja2.Template]: """Load a list of template files from disk using the given variables. @@ -210,6 +213,9 @@ class Config: custom_template_directory: A directory to try to look for the templates before using the default Synapse template directory instead. + autoescape: Whether to autoescape variables before inserting them into the + template. + Raises: ConfigError: if the file's path is incorrect or otherwise cannot be read. @@ -233,7 +239,7 @@ class Config: search_directories.insert(0, custom_template_directory) loader = jinja2.FileSystemLoader(search_directories) - env = jinja2.Environment(loader=loader, autoescape=True) + env = jinja2.Environment(loader=loader, autoescape=autoescape) # Update the environment with our custom filters env.filters.update(