Skip to content

Commit e0cd371

Browse files
author
Richard Jones
committed
Quote the value put in the text input value attribute.
1 parent 73a1047 commit e0cd371

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

template.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# $Id: template.py,v 1.4 2001-07-19 06:27:07 anthonybaxter Exp $
1+
# $Id: template.py,v 1.5 2001-07-20 07:34:43 richard Exp $
22

3-
import os, re, StringIO, urllib
3+
import os, re, StringIO, urllib, cgi
44

55
import hyperdb, date
66

@@ -68,6 +68,9 @@ def __call__(self, property, size=None, height=None, showid=0):
6868
size = size or 30
6969
if value is None:
7070
value = ''
71+
else:
72+
value = cgi.escape(value)
73+
value = '"'.join(value.split('"'))
7174
s = '<input name="%s" value="%s" size="%s">'%(property, value, size)
7275
elif propclass.isLinkType:
7376
linkcl = self.db.classes[propclass.classname]
@@ -697,6 +700,13 @@ def newitem(fp, db, classname, form, replace=re.compile(
697700

698701
#
699702
# $Log: not supported by cvs2svn $
703+
# Revision 1.4 2001/07/19 06:27:07 anthonybaxter
704+
# fixing (manually) the (dollarsign)Log(dollarsign) entries caused by
705+
# my using the magic (dollarsign)Id(dollarsign) and (dollarsign)Log(dollarsign)
706+
# strings in a commit message. I'm a twonk.
707+
#
708+
# Also broke the help string in two.
709+
#
700710
# Revision 1.3 2001/07/19 05:52:22 anthonybaxter
701711
# Added CVS keywords Id and Log to all python files.
702712
#

0 commit comments

Comments
 (0)