[Checkins] SVN: z3c.pt/trunk/z3c/pt/ Always escape single quotes,
but only once.
Malthe Borch
mborch at gmail.com
Sat Feb 23 07:19:04 EST 2008
Log message for revision 84176:
Always escape single quotes, but only once.
Changed:
U z3c.pt/trunk/z3c/pt/clauses.py
U z3c.pt/trunk/z3c/pt/io.py
-=-
Modified: z3c.pt/trunk/z3c/pt/clauses.py
===================================================================
--- z3c.pt/trunk/z3c/pt/clauses.py 2008-02-23 11:46:55 UTC (rev 84175)
+++ z3c.pt/trunk/z3c/pt/clauses.py 2008-02-23 12:19:04 UTC (rev 84176)
@@ -374,7 +374,7 @@
for attribute, expression in static:
stream.out(' %s="%s"' %
(attribute,
- escape(expression, '"').replace("'", "\\'")))
+ escape(expression, '"')))
temp = stream.save()
@@ -525,7 +525,7 @@
stream.write("_out.write(str(_urf))")
stream.outdent()
else:
- stream.write("_out.write(str(_urf))")
+ stream.write("_out.write(str(_urf)")
def end(self, stream):
if self.count != 1:
Modified: z3c.pt/trunk/z3c/pt/io.py
===================================================================
--- z3c.pt/trunk/z3c/pt/io.py 2008-02-23 11:46:55 UTC (rev 84175)
+++ z3c.pt/trunk/z3c/pt/io.py 2008-02-23 12:19:04 UTC (rev 84176)
@@ -53,7 +53,8 @@
if self.queue:
queue = self.queue
self.queue = ''
- self.write("_out.write('%s')" % queue.replace('\n', '\\n'))
+ self.write("_out.write('%s')" %
+ queue.replace('\n', '\\n').replace("'", "\\'"))
def write(self, string):
self.cook()
More information about the Checkins
mailing list