Mercurial > p > roundup > code
comparison website/issues/html/page.html @ 4880:ca692423e401
Different approach to fix XSS in issue2550817
Encapsulate the error/ok message append method as add_ok_message and
add_error_message. The new approach escapes the messages when appending
-- at a point in the code where we still know where the message comes
from. Escaping is the default but can bei turned off. This also fixes
issue2550836 where certain messages may contain links.
Another advantage of the new fix is that users don't need to change
installed trackers and are secure by default.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Mon, 31 Mar 2014 18:19:23 +0200 |
| parents | 22d57206a93b |
| children | d24e156f9069 |
comparison
equal
deleted
inserted
replaced
| 4879:302c967d710c | 4880:ca692423e401 |
|---|---|
| 182 </div> <!-- navigation --> | 182 </div> <!-- navigation --> |
| 183 | 183 |
| 184 <div class="content"> | 184 <div class="content"> |
| 185 <h1 id="breadcrumb"><span metal:define-slot="body_title">body title</span></h1> | 185 <h1 id="breadcrumb"><span metal:define-slot="body_title">body title</span></h1> |
| 186 <p tal:condition="options/error_message | nothing" class="error-message" | 186 <p tal:condition="options/error_message | nothing" class="error-message" |
| 187 tal:repeat="m options/error_message" tal:content="m" /> | 187 tal:repeat="m options/error_message" |
| 188 tal:content="structure string:$m <br/ > " /> | |
| 188 <p tal:condition="options/ok_message | nothing" class="ok-message"> | 189 <p tal:condition="options/ok_message | nothing" class="ok-message"> |
| 189 <span tal:repeat="m options/ok_message" tal:content="m" /> | 190 <span tal:repeat="m options/ok_message" |
| 191 tal:content="structure string:$m <br/ > " /> | |
| 190 <a class="form-small" tal:attributes="href request/current_url" | 192 <a class="form-small" tal:attributes="href request/current_url" |
| 191 i18n:translate="">clear this message</a> | 193 i18n:translate="">clear this message</a> |
| 192 </p> | 194 </p> |
| 193 <tal:block metal:define-slot="content">Page content goes here</tal:block> | 195 <tal:block metal:define-slot="content">Page content goes here</tal:block> |
| 194 </div> <!-- content --> | 196 </div> <!-- content --> |
