[Zope-Checkins] CVS: Zope/lib/python/DocumentTemplate - DT_Var.py:1.57.6.2

Matthew T. Kromer matt@zope.com
Fri, 20 Sep 2002 15:14:26 -0400


Update of /cvs-repository/Zope/lib/python/DocumentTemplate
In directory cvs.zope.org:/tmp/cvs-serv5921/lib/python/DocumentTemplate

Modified Files:
      Tag: Zope-2_6-branch
	DT_Var.py 
Log Message:
Revert str->ustr changes which introduced unicode results where they
did not exist before.  This caused breakage in the security machinery and
potentially in other places.


=== Zope/lib/python/DocumentTemplate/DT_Var.py 1.57.6.1 => 1.57.6.2 ===
--- Zope/lib/python/DocumentTemplate/DT_Var.py:1.57.6.1	Mon Sep 16 06:10:25 2002
+++ Zope/lib/python/DocumentTemplate/DT_Var.py	Fri Sep 20 15:13:56 2002
@@ -284,7 +284,7 @@
         if fmt=='s':
             # Keep tainted strings as tainted strings here.
             if not isinstance(val, TaintedString):
-                val=ustr(val)
+                val=str(val)
         else:
             # Keep tainted strings as tainted strings here.
             wastainted = 0
@@ -350,7 +350,7 @@
     # Unsafe data is explicitly quoted here; we don't expect this to be HTML
     # quoted later on anyway.
     if isinstance(v, TaintedString): v = v.quoted()
-    v=ustr(v)
+    v=str(v)
     if v.find('\r') >= 0: v=''.join(v.split('\r'))
     if v.find('\n') >= 0: v='<br />\n'.join(v.split('\n'))
     return v