Skip to content

Commit

Permalink
Merge pull request #3165 from jeremy886/master
Browse files Browse the repository at this point in the history
change cgi.escape to pyramid compat.escape
  • Loading branch information
digitalresistor committed Aug 30, 2017
2 parents df2a517 + cae6da8 commit c536359
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/quick_tour/views/views.py
@@ -1,4 +1,4 @@
import cgi
from pyramid.compat import escape

from pyramid.httpexceptions import HTTPFound
from pyramid.response import Response
Expand All @@ -17,7 +17,7 @@ def hello_view(request):
name = request.params.get('name', 'No Name')
body = '<p>Hi %s, this <a href="/goto">redirects</a></p>'
# cgi.escape to prevent Cross-Site Scripting (XSS) [CWE 79]
return Response(body % cgi.escape(name))
return Response(body % escape(name))


# /goto which issues HTTP redirect to the last view
Expand Down

0 comments on commit c536359

Please sign in to comment.