Skip to content

Commit 862d38d

Browse files
author
Richard Jones
committed
Handle multiple @action values from broken trackers
1 parent f97738b commit 862d38d

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
This file contains the changes to the Roundup system over time. The entries
22
are given with the most recent entry first.
33

4+
2010-??0?? 1.5.1
5+
6+
Fixed:
7+
- Handle multiple @action values from broken trackers.
8+
9+
410
2010-02-23 1.5.0
511

612
Fixed:

roundup/cgi/client.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,17 @@ def check_anonymous_access(self):
733733
"""
734734
# allow Anonymous to use the "login" and "register" actions (noting
735735
# that "register" has its own "Register" permission check)
736+
736737
if ':action' in self.form:
737-
action = self.form[':action'].value.lower()
738+
action = self.form[':action']
738739
elif '@action' in self.form:
739-
action = self.form['@action'].value.lower()
740+
action = self.form['@action']
741+
else:
742+
action = ''
743+
if isinstance(action, list):
744+
raise SeriousError('broken form: multiple @action values submitted')
740745
else:
741-
action = None
746+
action = action.value.lower()
742747
if action in ('login', 'register'):
743748
return
744749

@@ -1115,12 +1120,17 @@ def handle_action(self):
11151120
present their messages to the user.
11161121
"""
11171122
if ':action' in self.form:
1118-
action = self.form[':action'].value.lower()
1123+
action = self.form[':action']
11191124
elif '@action' in self.form:
1120-
action = self.form['@action'].value.lower()
1125+
action = self.form['@action']
11211126
else:
11221127
return None
11231128

1129+
if isinstance(action, list):
1130+
raise SeriousError('broken form: multiple @action values submitted')
1131+
else:
1132+
action = action.value.lower()
1133+
11241134
try:
11251135
action_klass = self.get_action_class(action)
11261136

0 commit comments

Comments
 (0)