summaryrefslogtreecommitdiff
path: root/docs/tutorials
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2013-12-12 16:06:57 -0500
committerChris McDonough <chrism@plope.com>2013-12-12 16:06:57 -0500
commitc4cd124e05b54c675dde63889b1cce50dd57d7f1 (patch)
treea88f829c5026e8c8821dd06a31c443af2bef4757 /docs/tutorials
parent28c26c17d66b563140e60b95ca1ea7e6dc3ccb6c (diff)
parent2617e2198fac67364b195a12e228da20c3f8afee (diff)
downloadpyramid-c4cd124e05b54c675dde63889b1cce50dd57d7f1.tar.gz
pyramid-c4cd124e05b54c675dde63889b1cce50dd57d7f1.tar.bz2
pyramid-c4cd124e05b54c675dde63889b1cce50dd57d7f1.zip
Merge branch 'wichert-jsonp-syntax'
Diffstat (limited to 'docs/tutorials')
-rw-r--r--docs/tutorials/wiki2/src/views/tutorial/views.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/tutorials/wiki2/src/views/tutorial/views.py b/docs/tutorials/wiki2/src/views/tutorial/views.py
index 42ef77b98..b41d4ab40 100644
--- a/docs/tutorials/wiki2/src/views/tutorial/views.py
+++ b/docs/tutorials/wiki2/src/views/tutorial/views.py
@@ -1,3 +1,4 @@
+import cgi
import re
from docutils.core import publish_parts
@@ -32,10 +33,10 @@ def view_page(request):
exists = DBSession.query(Page).filter_by(name=word).all()
if exists:
view_url = request.route_url('view_page', pagename=word)
- return '<a href="%s">%s</a>' % (view_url, word)
+ return '<a href="%s">%s</a>' % (view_url, cgi.escape(word))
else:
add_url = request.route_url('add_page', pagename=word)
- return '<a href="%s">%s</a>' % (add_url, word)
+ return '<a href="%s">%s</a>' % (add_url, cgi.escape(word))
content = publish_parts(page.data, writer_name='html')['html_body']
content = wikiwords.sub(check, content)