Skip to content

Commit

Permalink
Merge pull request #4241 from Osmose/no-escape-bugzilla-comments
Browse files Browse the repository at this point in the history
Fix bug 1423211: Do not escape stack frames in pre-filled Bugzilla comments.
  • Loading branch information
Osmose authored Dec 6, 2017
2 parents 96481d1 + 7253094 commit ae0b7de
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ report bp-{{ uuid }}.
Top {{ crashing_thread_frames|length }} frames of crashing thread:

{% for frame in crashing_thread_frames -%}
{{ frame.frame }} {{ frame.module }} {{ frame.signature }} {{ frame.source }}
{{ frame.frame|safe}} {{ frame.module|safe }} {{ frame.signature|safe }} {{ frame.source|safe }}
{% endfor %}
=============================================================
{% endif %}
20 changes: 20 additions & 0 deletions webapp-django/crashstats/crashstats/tests/test_jinja_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,26 @@ def test_comment_missing_everything(self):
])
bugzilla_submit_url(report, parsed_dump, 0, 'Core')

def test_comment_no_html_escaping(self):
"""If a frame contains <, >, &, or ", they should not be HTML
escaped in the comment body.
"""
report = self._create_report()
parsed_dump = self._create_dump(threads=[
self._create_thread(frames=[
self._create_frame(
frame=0,
module='&test_module',
signature='foo<char>::bar(char* x, int y)',
file='"foo".cpp',
line=7,
),
])
])
url = bugzilla_submit_url(report, parsed_dump, 0, 'Core')
assert quote_plus('0 &test_module foo<char>::bar "foo".cpp:7') in url


class TestReplaceBugzillaLinks(TestCase):
def test_simple(self):
Expand Down

0 comments on commit ae0b7de

Please sign in to comment.