Opened 8 years ago
Last modified 8 years ago
#12517 closed defect
invalid verification in `_arg_as_int()` — at Initial Version
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | 1.0.12 |
Component: | wiki system | Version: | 1.0-stable |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
the value returned by as_int()
should be checked against None
, otherwise we it is not possible to use 0 as value for some parameters as depth
example:
[[TitleIndex(Wiki, depth=0)]]
results in:
proposed fix:
-
trac/wiki/macros.py
diff --git a/trac/wiki/macros.py b/trac/wiki/macros.py index 345cb53..450393d 100644
a b class TracGuideTocMacro(WikiMacroBase): 915 915 916 916 def _arg_as_int(val, key=None, min=None, max=None): 917 917 int_val = as_int(val, None, min=min, max=max) 918 if not int_val:918 if int_val is None: 919 919 raise MacroError(tag_("Invalid macro argument %(expr)s", 920 920 expr=tag.code("%s=%s" % (key, val)) 921 921 if key else tag.code(val)))
Note:
See TracTickets
for help on using tickets.