| 1 |
Index: _cputil.py |
|---|
| 2 |
=================================================================== |
|---|
| 3 |
--- _cputil.py (revision 692) |
|---|
| 4 |
+++ _cputil.py (working copy) |
|---|
| 5 |
@@ -33,6 +33,7 @@ |
|---|
| 6 |
import sys |
|---|
| 7 |
import traceback |
|---|
| 8 |
import time |
|---|
| 9 |
+import cgi |
|---|
| 10 |
|
|---|
| 11 |
import cherrypy |
|---|
| 12 |
from cherrypy.lib import cptools |
|---|
| 13 |
@@ -151,11 +152,11 @@ |
|---|
| 14 |
f.close() |
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
-_HTTPErrorTemplate = '''<?xml version="1.0" encoding="UTF-8"?> |
|---|
| 18 |
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
|---|
| 19 |
+_HTTPErrorTemplate = '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
|---|
| 20 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|---|
| 21 |
<html> |
|---|
| 22 |
<head> |
|---|
| 23 |
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
|---|
| 24 |
<title>%(status)s</title> |
|---|
| 25 |
<style type="text/css"> |
|---|
| 26 |
#poweredBy { |
|---|
| 27 |
@@ -202,6 +203,8 @@ |
|---|
| 28 |
for k, v in kwargs.iteritems(): |
|---|
| 29 |
if v is None: |
|---|
| 30 |
kwargs[k] = "" |
|---|
| 31 |
+ else: |
|---|
| 32 |
+ kwargs[k] = cgi.escape(kwargs[k]) |
|---|
| 33 |
|
|---|
| 34 |
template = _HTTPErrorTemplate |
|---|
| 35 |
errorPageFile = cherrypy.config.get('errorPage.%s' % code, '') |
|---|