File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # -*- coding: utf-8 -*-
2+
13# CTK: Cherokee Toolkit
24#
35# Authors:
3537from Post import Post
3638from HTTP import HTTP_Response , HTTP_Error
3739
40+ from cgi import escape as escape_html
41+
3842
3943class PostValidator :
4044 def __init__ (self , post , validation_list ):
@@ -139,9 +143,6 @@ def manage_exception():
139143 print >> sys .stderr , info
140144
141145 # Custom error management
142- #page = error.page (info, desc)
143- #response = HTTP_Response (error=500, body=page.Render())
144- #self.send (str(response))
145146 if error .page :
146147 try :
147148 page = error .page (info , desc )
@@ -153,7 +154,7 @@ def manage_exception():
153154 pass
154155
155156 # No error handling page
156- html = '<pre>%s</pre>' % ( info )
157+ html = '<pre>%s</pre>' % ( escape_html ( info ) )
157158 self .send (str (HTTP_Error (desc = html )))
158159
159160 try :
You can’t perform that action at this time.
0 commit comments