keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
20.17k stars 1.42k forks source link

Fix backup file path substitution #10834

Closed c4rlo closed 3 weeks ago

c4rlo commented 1 month ago

Previously, in a pattern like "{TIME:yy} {TIME}", Tools::substituteBackupFilePath() would greedily use the entire string "yy} {TIME" as the format specifier for the first TIME template, instead of just "yy". Fix this, by adjusting the regular expression.

This ends up changing the behaviour of a weird corner case that is covered in the tests, so change the test. I don't think anyone cares about that case, and I think the current behaviour is better there.

Fixes #10505 (proved by adding a test case very similar to what was reported there).

Type of change

droidmonkey commented 1 month ago

Agree the corner case isn't a valid substitution syntax anyway