From 670c644ff5708cc333a3eddb054dc97c6f05634c Mon Sep 17 00:00:00 2001 From: mtredinnick Date: Tue, 20 Nov 2007 01:37:16 +0000 Subject: [PATCH] Fixed #5974 -- Added autoescaping for source code lines and local variables in technical debug page. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6704 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/views/debug.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/django/views/debug.py b/django/views/debug.py index 7c45af23..3358d2f0 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -422,11 +422,11 @@ TECHNICAL_500_TEMPLATE = """ {% if frame.context_line %}
{% if frame.pre_context %} -
    {% for line in frame.pre_context %}
  1. {{ line }}
  2. {% endfor %}
+
    {% for line in frame.pre_context %}
  1. {{ line|escape }}
  2. {% endfor %}
{% endif %} -
  1. {{ frame.context_line }} ...
+
  1. {{ frame.context_line|escape }} ...
{% if frame.post_context %} -
    {% for line in frame.post_context %}
  1. {{ line }}
  2. {% endfor %}
+
    {% for line in frame.post_context %}
  1. {{ line|escape }}
  2. {% endfor %}
{% endif %}
{% endif %} @@ -445,8 +445,8 @@ TECHNICAL_500_TEMPLATE = """ {% for var in frame.vars|dictsort:"0" %} - {{ var.0 }} -
{{ var.1|pprint }}
+ {{ var.0|escape }} +
{{ var.1|pprint|escape }}
{% endfor %} @@ -466,7 +466,7 @@ Traceback (most recent call last):
{% for frame in frames %} File "{{ frame.filename }}" in {{ frame.function }}
{% if frame.context_line %} -   {{ frame.lineno }}. {{ frame.context_line }}
+   {{ frame.lineno }}. {{ frame.context_line|escape }}
{% endif %} {% endfor %}
  {{ exception_type }} at {{ request.path|escape }}
-- 2.11.4.GIT