summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 46cdbc7)
raw | patch | inline | side by side (parent: 46cdbc7)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 9 Oct 2002 01:00:41 +0000 (01:00 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 9 Oct 2002 01:00:41 +0000 (01:00 +0000) |
- homogenise newlines in CGI text submissions (sf bug 614072)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1327 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1327 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
doc/customizing.txt | patch | blob | history | |
roundup/cgi/client.py | patch | blob | history | |
roundup/cgi/templating.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 5d2c2fb189b02a2076a9354dde89edd5b5c90c32..b1e26f9993f8ce4c1f02b33814f8767f5ed50733 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- nicer display of tracker list in roundup-server (sf bug 619769)
- fixed some missed renaming instance -> tracker (sf bug 619769)
- allow blank passwords again (sf bug 619714)
+- expose the tracker config as a variable for templating
+- homogenise newlines in CGI text submissions (sf bug 614072)
2002-10-02 0.5.0
diff --git a/doc/customizing.txt b/doc/customizing.txt
index fec578b7097208bf98645f3f4722bdcd2805db49..e77feff2f76a314ea493848dd443d26160c1909a 100644 (file)
--- a/doc/customizing.txt
+++ b/doc/customizing.txt
Customising Roundup
===================
-:Version: $Revision: 1.53 $
+:Version: $Revision: 1.54 $
.. This document borrows from the ZopeBook section on ZPT. The original is at:
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
- *form*
The current CGI form information as a mapping of form argument
name to value
-**tracker**
- The current tracker
+**config**
+ This variable holds all the values defined in the tracker config.py file
+ (eg. TRACKER_NAME, etc.)
**db**
- The current database, through which db.config may be reached.
+ The current database, used to access arbitrary database items.
**templates**
Access to all the tracker templates by name. Used mainly in *use-macro*
commands.
diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py
index 635cf72c037c832558ca46280108ab15fe3fe6fe..8ac665d32243a1b2dc0c0a68035e5118e3154179 100644 (file)
--- a/roundup/cgi/client.py
+++ b/roundup/cgi/client.py
-# $Id: client.py,v 1.51 2002-10-08 04:11:17 richard Exp $
+# $Id: client.py,v 1.52 2002-10-09 01:00:40 richard Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
# in a nutshell, don't do anything if there's no note or there's no
# NOSY
if self.form.has_key(':note'):
- note = self.form[':note'].value.strip()
+ # fix the CRLF/CR -> LF stuff
+ note = fixNewlines(self.form[':note'].value.strip())
if not note:
return None, files
if not props.has_key('messages'):
link = self.db.classes[link]
link.set(nodeid, **{property: nid})
+def fixNewlines(text):
+ ''' Homogenise line endings.
+
+ Different web clients send different line ending values, but
+ other systems (eg. email) don't necessarily handle those line
+ endings. Our solution is to convert all line endings to LF.
+ '''
+ text = text.replace('\r\n', '\n')
+ return text.replace('\r', '\n')
def parsePropsFromForm(db, cl, form, nodeid=0, num_re=re.compile('^\d+$')):
''' Pull properties for the given class out of the form.
if isinstance(proptype, hyperdb.String):
if not value:
continue
+ # fix the CRLF/CR -> LF stuff
+ value = fixNewlines(value)
elif isinstance(proptype, hyperdb.Password):
if not value:
# ignore empty password values
index 9f24a19fe400831077aebdc1b7f8886d62661b2f..4c4a13b3656ab9865bd139874e51d0f6cbdeabf5 100644 (file)
- methods for easy filterspec link generation
- *user*, the current user node as an HTMLItem instance
- *form*, the current CGI form information as a FieldStorage
- *tracker*
- The current tracker
+ *config*
+ The current tracker config.
*db*
- The current database, through which db.config may be reached.
+ The current database, used to access arbitrary database items.
'''
def getContext(self, client, classname, request):
c = {
'nothing': None,
'request': request,
'db': HTMLDatabase(client),
+ 'config': client.instance.config,
'tracker': client.instance,
'utils': TemplatingUtils(client),
'templates': Templates(client.instance.config.TEMPLATES),