summaryrefslogtreecommitdiff
path: root/docs/tutorials
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2014-01-21 23:22:50 -0500
committerChris McDonough <chrism@plope.com>2014-01-21 23:22:50 -0500
commitdec681201ec50c261bde022ea09d24f09e3588bd (patch)
treeb3717a84ca3c3001072ef2e4ab759a4574a7324f /docs/tutorials
parent5c4318abe647b65869ac6dbb5b57cf1088712061 (diff)
parentdf6065fb1c3724649ac6e75cfcabc273ef6fd0d9 (diff)
downloadpyramid-dec681201ec50c261bde022ea09d24f09e3588bd.tar.gz
pyramid-dec681201ec50c261bde022ea09d24f09e3588bd.tar.bz2
pyramid-dec681201ec50c261bde022ea09d24f09e3588bd.zip
Merge branch 'master' of github.com:Pylons/pyramid
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)