Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 8320:b07165add61b
fix(web): issue2551406 - dont crash when handed invalid @template=a|b|c
Only two template cases (ok and error) are handled. Presence of second
'|' caused crash. Discovered/patch provided by Christof Meerwald
(cmeerw).
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 02 Jun 2025 08:52:39 -0400 |
| parents | 80105cd30368 |
| children | 4e2ffa4151cb |
comparison
equal
deleted
inserted
replaced
| 8319:5e6ff4e9cacb | 8320:b07165add61b |
|---|---|
| 2193 # determine if view is oktmpl|errortmpl. If so assign the | 2193 # determine if view is oktmpl|errortmpl. If so assign the |
| 2194 # right one to the view parameter. If we don't have alternate | 2194 # right one to the view parameter. If we don't have alternate |
| 2195 # templates, just leave view alone. | 2195 # templates, just leave view alone. |
| 2196 if (view and view.find('|') != -1): | 2196 if (view and view.find('|') != -1): |
| 2197 # we have alternate templates, parse them apart. | 2197 # we have alternate templates, parse them apart. |
| 2198 (oktmpl, errortmpl) = view.split("|", 2) | 2198 (oktmpl, errortmpl) = view.split("|", 1) |
| 2199 | 2199 |
| 2200 # Choose the right template | 2200 # Choose the right template |
| 2201 view = errortmpl if self._error_message else oktmpl | 2201 view = errortmpl if self._error_message else oktmpl |
| 2202 | 2202 |
| 2203 loader = self.instance.templates | 2203 loader = self.instance.templates |
