[Zope-Checkins] CVS: Zope2 - HTTPRequest.py:1.53 cgi.py:NONE
shane@digicool.com
shane@digicool.com
Fri, 27 Apr 2001 16:28:00 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/ZPublisher
In directory korak:/tmp/cvs-serv17686/lib/python/ZPublisher
Modified Files:
HTTPRequest.py
Removed Files:
cgi.py
Log Message:
Merged RestrictedPythonBranch!
--- Updated File HTTPRequest.py in package Zope2 --
--- HTTPRequest.py 2001/04/26 13:32:36 1.52
+++ HTTPRequest.py 2001/04/27 20:27:58 1.53
@@ -89,7 +89,7 @@
from string import lower, atoi, rfind, split, strip, join, upper, find
from BaseRequest import BaseRequest
from HTTPResponse import HTTPResponse
-from cgi import FieldStorage
+from cgi import FieldStorage, escape
from urllib import quote, unquote, splittype, splitport
from Converters import get_converter
from maybe_lock import allocate_lock
@@ -934,28 +934,28 @@
result="<h3>form</h3><table>"
row='<tr valign="top" align="left"><th>%s</th><td>%s</td></tr>'
for k,v in self.form.items():
- result=result + row % (html_quote(k), html_quote(repr(v)))
+ result=result + row % (escape(k), escape(repr(v)))
result=result+"</table><h3>cookies</h3><table>"
for k,v in self.cookies.items():
- result=result + row % (html_quote(k), html_quote(repr(v)))
+ result=result + row % (escape(k), escape(repr(v)))
result=result+"</table><h3>other</h3><table>"
for k,v in self.other.items():
if k in ('PARENTS','RESPONSE'): continue
- result=result + row % (html_quote(k), html_quote(repr(v)))
+ result=result + row % (escape(k), escape(repr(v)))
for n in "0123456789":
key = "URL%s"%n
- try: result=result + row % (key, html_quote(self[key]))
+ try: result=result + row % (key, escape(self[key]))
except KeyError: pass
for n in "0123456789":
key = "BASE%s"%n
- try: result=result + row % (key, html_quote(self[key]))
+ try: result=result + row % (key, escape(self[key]))
except KeyError: pass
result=result+"</table><h3>environ</h3><table>"
for k,v in self.environ.items():
if not hide_key(k):
- result=result + row % (html_quote(k), html_quote(v))
+ result=result + row % (escape(k), escape(repr(v)))
return result+"</table>"
__repr__=__str__
@@ -989,21 +989,6 @@
try: del dict['HTTP_CGI_AUTHORIZATION']
except: pass
return dict
-
-
-# This is duplicated from DocumentTemplate.DT_Util to
-# prevent a dependency on the DocumentTemplate package.
-# Some folks still use the ZPublisher package as a
-# standalone publisher without DocumentTemplate.
-def html_quote(value, character_entities=(
- (('&'), '&'),
- (("<"), '<' ),
- ((">"), '>' ),
- (('"'), '"'))): #"
- text=str(value)
- for re, name in character_entities:
- if find(text, re) >= 0: text=join(split(text, re), name)
- return text
def str_field(v):
--- Removed file cgi.py from package Zope2 --