mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-13 01:28:28 +02:00
### What / why `TimeEstimateParse` (used by the issue time-estimate form) only checked that the first token starts at the beginning of the string and the last token ends at its end, but never checked the gaps between consecutive tokens. Non-whitespace garbage embedded between two valid units was silently dropped and the string accepted with a wrong value instead of being reported as invalid. Examples that were wrongly accepted before this change: - `1h 2x 3m` → 3780s (parsed as 1h3m) - `1h_2m` → 3720s - `1h,1m` → 3660s All three now return an "invalid time string" error, while valid inputs such as `1h 1m 1s` and `1h1m1s` keep working. ### How Reject any non-whitespace content between two matched units. --------- Signed-off-by: TowyTowy <towy@airreps.link> Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>