Skip to content

Commit

Permalink
Merge pull request #3173 from stevepiercy/1.8-branch
Browse files Browse the repository at this point in the history
use pyramid.compat.escape instead of cgi.escape
  • Loading branch information
stevepiercy authored Sep 23, 2017
2 parents b27b3d8 + f48dc6a commit 356c9f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/quick_tour/views/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cgi
from pyramid.compat import escape

from pyramid.httpexceptions import HTTPFound
from pyramid.response import Response
Expand All @@ -16,8 +16,8 @@ def home_view(request):
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))
# pyramid.compat.escape to prevent Cross-Site Scripting (XSS) [CWE 79]
return Response(body % escape(name))


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

0 comments on commit 356c9f0

Please sign in to comment.