diff 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
line wrap: on
line diff
--- a/roundup/cgi/client.py	Sun May 11 20:31:16 2025 -0400
+++ b/roundup/cgi/client.py	Mon Jun 02 08:52:39 2025 -0400
@@ -2195,7 +2195,7 @@
         # templates, just leave view alone.
         if (view and view.find('|') != -1):
             # we have alternate templates, parse them apart.
-            (oktmpl, errortmpl) = view.split("|", 2)
+            (oktmpl, errortmpl) = view.split("|", 1)
 
             # Choose the right template
             view = errortmpl if self._error_message else oktmpl

Roundup Issue Tracker: http://roundup-tracker.org/