summaryrefslogtreecommitdiff
path: root/docs/quick_tour
diff options
context:
space:
mode:
authorJeremy Chen <jeremy886@gmail.com>2017-08-30 22:35:18 +1000
committerJeremy Chen <jeremy886@gmail.com>2017-08-30 22:35:18 +1000
commitcae6da810e5b0571a8e5f46da619fa7761ee62b9 (patch)
tree7b35fd20e372b2d94fd9c402a95a5468da4ccc57 /docs/quick_tour
parentdf2a517acb68100c679fc38bf0c53c5c15dde62f (diff)
downloadpyramid-cae6da810e5b0571a8e5f46da619fa7761ee62b9.tar.gz
pyramid-cae6da810e5b0571a8e5f46da619fa7761ee62b9.tar.bz2
pyramid-cae6da810e5b0571a8e5f46da619fa7761ee62b9.zip
change cgi.escape to pyramid compat.escape
Diffstat (limited to 'docs/quick_tour')
-rw-r--r--docs/quick_tour/views/views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/quick_tour/views/views.py b/docs/quick_tour/views/views.py
index 1449cbb38..9db8ef3c4 100644
--- a/docs/quick_tour/views/views.py
+++ b/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
@@ -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