diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-11-20 22:18:07 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-11-23 11:52:54 +0100 |
| commit | 98ac69af538f8d93d6f940b382dcce2d5fc6173a (patch) | |
| tree | f71b5804df60a8132a5e645ef7dff73bfce3ee34 | |
| parent | 246cfdeae3f80bd159f8bd1dcb01921b4ce92720 (diff) | |
Encapsulated ALLOWED_INCLUDE_ROOTS in Engine.
| -rw-r--r-- | django/template/defaulttags.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index 0defc17057..fa1cbfa98e 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -375,9 +375,9 @@ class RegroupNode(Node): return '' -def include_is_allowed(filepath): +def include_is_allowed(filepath, allowed_include_roots): filepath = os.path.abspath(filepath) - for root in settings.ALLOWED_INCLUDE_ROOTS: + for root in allowed_include_roots: if filepath.startswith(root): return True return False @@ -391,7 +391,7 @@ class SsiNode(Node): def render(self, context): filepath = self.filepath.resolve(context) - if not include_is_allowed(filepath): + if not include_is_allowed(filepath, context.engine.allowed_include_roots): if settings.DEBUG: return "[Didn't have permission to include file]" else: |
