Skip to content

Commit 4038ecc

Browse files
committed
Revert boolean attribute rendering
Revert (part of) the change that optimizes rendering of boolean attributes in HTML-4. This breaks rendering of non-boolean attributes (like name="name").
1 parent b9102ef commit 4038ecc

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

CHANGES.txt

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ Fixed:
8585
for translations. (Report: John Rouillard; Fix: Christof Meerwald)
8686
- Cleanup code by linting using flake8. (John Rouillard)
8787
- Cleanup code by security linting using bandit. (John Rouillard)
88+
- Revert (part of) the change that optimizes rendering of boolean
89+
attributes in HTML-4. This breaks rendering of non-boolean attributes
90+
(like name="name"). (Ralf Schlatterbeck)
8891

8992
2019-10-23 2.0.0 alpha 0
9093

@@ -198,12 +201,12 @@ Fixed:
198201
- issue2550992: avoid errors from invalid Authorization
199202
headers. (Joseph Myers)
200203
- issue2551022: support non-ASCII prefixes in instance config for
201-
finding static files. (C�dric Krier)
204+
finding static files. (C\E9dric Krier)
202205
- issue2551023: Fix CSRF headers for use with wsgi and cgi. The
203206
env variable array used - separators rather than _. Compare:
204207
HTTP_X-REQUESTED-WITH to HTTP_X_REQUESTED_WITH. The last is
205208
correct. Also fix roundup-server to produce the latter form. (Patch
206-
by C�dric Krier, reviewed/applied John Rouillard.)
209+
by C\E9dric Krier, reviewed/applied John Rouillard.)
207210
- issue2551035 - fix XSS issue in wsgi and cgi when handing url not
208211
found/404. Reported by hannob at
209212
https://github.com/python/bugs.python.org/issues/34, issue opened by
@@ -218,9 +221,9 @@ Fixed:
218221
when using the anydbm backend (John Rouillard)
219222
- issue2551041 - change permission check from "Create User" to "Register
220223
User" in page.html for the responsive and devel templates. (reporter
221-
C�dric Krier, John Rouillard)
224+
C\E9dric Krier, John Rouillard)
222225
- issue2550144 - fix use of undefined icing macro in devel
223-
template. Replace with frame macro. (C�dric Krier)
226+
template. Replace with frame macro. (C\E9dric Krier)
224227
- handle UnicodeDecodeError in file class when file contents are
225228
not text (e.g. jpg). (John Rouillard)
226229
- issue2551033: prevent reverse engineering hidden data by using etags
@@ -1082,7 +1085,7 @@ Features:
10821085
Fixed:
10831086

10841087
- issue2550765: Don't show links in calendar that will fail.
1085-
Found and fixed by C�dric Krier. (Bernhard)
1088+
Found and fixed by C\E9dric Krier. (Bernhard)
10861089
- issue2550765: use <meta name="robots" content="noindex, nofollow"> in the
10871090
_generic.calendar.html to prevent robots to follow all the links in the
10881091
calendar. (Ezio Melotti)
@@ -1174,9 +1177,9 @@ Fixed:
11741177
- issue2550728: remove buggy parentheses in TAL/DummyEngine.py.
11751178
Reported and fixed by Ralf Hemmecke. (Bernhard)
11761179
- issue2550715: IndexError when requesting non-existing file via http.
1177-
Reported and fixed by C�dric Krier. (Bernhard)
1180+
Reported and fixed by C\E9dric Krier. (Bernhard)
11781181
- issue2550712: exportcsvaction errors poorly when given invalid columns.
1179-
Reported by Will Kahn-Greene, fixed by C�dric Krier. (Bernhard)
1182+
Reported by Will Kahn-Greene, fixed by C\E9dric Krier. (Bernhard)
11801183
- issue2550695: 'No sort or group' settings not retained when editing queries.
11811184
Reported and fixed by John Kristensen. Tested by Satchidanand Haridas.
11821185
(Bernhard)
@@ -1278,7 +1281,7 @@ Fixed:
12781281
need to use a BytesIO which gets the utf-8 string from the
12791282
web-interface. Compatibility for old versions by using
12801283
StringIO.StringIO for emulating a io.BytesIO also works.
1281-
Thanks to C�dric Krier for reporting. Closes issue2550713.
1284+
Thanks to C\E9dric Krier for reporting. Closes issue2550713.
12821285
Added a regression test for EditCSVAction (Ralf)
12831286
- Fix issue2550691 where a Unix From-Header was sometimes inserted in
12841287
outgoing emails, thanks to Joseph Myers for the patch. (Ralf)
@@ -1422,7 +1425,7 @@ Fixed:
14221425

14231426
- fixed reporting of source missing warnings
14241427
- relevant tests made locale independent, issue2550660 (thanks
1425-
Benni B�rmann for reporting).
1428+
Benni B\E4rmann for reporting).
14261429
- fix for incorrect except: syntax, issue2550661 (thanks Jakub Wilk)
14271430
- No longer use the root logger, use a logger with prefix "roundup",
14281431
see http://thread.gmane.org/gmane.comp.bug-tracking.roundup.devel/5356
@@ -1438,7 +1441,7 @@ Fixed:
14381441
which roundup interprets as a Reject exception. Fixes issue2550667.
14391442
Added regression tests for message/rfc822 attachments with and without
14401443
configured unpacking (mailgw unpack_rfc822, see Features above)
1441-
Thanks to Benni B�rmann for reporting.
1444+
Thanks to Benni B\E4rmann for reporting.
14421445
- Allow search_popup macro to work with all db classes, issue2550567
14431446
(thanks John Kristensen)
14441447
- lower memory footprint for (journal-) import
@@ -1556,7 +1559,7 @@ Fixes:
15561559
fix mailgw to use Register permission, fixes issue2550599
15571560
- Fix styling of calendar to make it more usable, fixes issue2550608
15581561
- Fix typo in email section of user guide, fixes issue2550607
1559-
- Fix WSGI response code (thanks Peter P�ml)
1562+
- Fix WSGI response code (thanks Peter P\F6ml)
15601563
- Fix linking of an existing item to a newly created item, e.g.
15611564
edit action in web template is name="issue-1@link@msg" value="msg1"
15621565
would trigger a traceback about an unbound variable.
@@ -1707,9 +1710,9 @@ Feature:
17071710
- Admin copy of error email from mailgw includes traceback (thanks Ulrik
17081711
Mikaelsson)
17091712
- Messages created through the web are now given an in-reply-to header
1710-
when email out to nosy (thanks Martin v. L�wis)
1713+
when email out to nosy (thanks Martin v. L\F6wis)
17111714
- Nosy messages now include more information about issues (all link
1712-
properties with a "name" attribute) (thanks Martin v. L�wis)
1715+
properties with a "name" attribute) (thanks Martin v. L\F6wis)
17131716

17141717
Fixed:
17151718
- Searching date range by supplying just a date as the filter spec
@@ -3384,7 +3387,7 @@ Feature:
33843387
feature, and we hope to add support for it to the web gateway.
33853388

33863389
Fixed:
3387-
- Lots of bugs, thanks Roch and others on the devel mailing list!
3390+
- Lots of bugs, thanks Roch\E9 and others on the devel mailing list!
33883391
- login_action and newuser_action return values were being ignored
33893392
- Woohoo! Found that bloody re-login bug that was killing the mail
33903393
gateway.

roundup/cgi/templating.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def html4_cgi_escape_attrs(**attrs):
443443
<input required ..> not <input required="required" ...>
444444
The latter is xhtml. Recognize booleans by:
445445
value is None
446-
value is the same as the atribute
446+
value is the same as the attribute
447447
Code can use either method to indicate a pure boolean.
448448
'''
449449
return ' '.join(['%s="%s"'%(k,html_escape(str(v), True))
@@ -480,12 +480,11 @@ def __init__(self):
480480
html_version = 'html4'
481481
if hasattr(self._client.instance.config, 'HTML_VERSION'):
482482
html_version = self._client.instance.config.HTML_VERSION
483-
if html_version == 'xhtml':
484-
self.input = input_xhtml
485-
self.cgi_escape_attrs=xhtml_cgi_escape_attrs
486-
else:
487-
self.input = input_html4
488-
self.cgi_escape_attrs=html4_cgi_escape_attrs
483+
# HTML-4 allows attributes like required=required, so for now
484+
# revert the change that optimizes this and breaks rendering of
485+
# non-boolean attributes (like name="name").
486+
self.input = input_xhtml
487+
self.cgi_escape_attrs=xhtml_cgi_escape_attrs
489488
# self._context is used for translations.
490489
# will be initialized by the first call to .gettext()
491490
self._context = None

0 commit comments

Comments
 (0)