Skip to content

Conversation

c4rlo
Copy link
Contributor

@c4rlo c4rlo commented May 30, 2024

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

  • ✅ Bug fix (non-breaking change that fixes an issue)

@droidmonkey
Copy link
Member

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

Previously, in a pattern like "{TIME:yy} {TIME}",
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 keepassxreboot#10505 (proved by adding a test case very similar to what was
reported there).
@c4rlo c4rlo force-pushed the fix-backup-placeholders branch from 3e5f35d to 3cf98c8 Compare May 31, 2024 19:12
@droidmonkey droidmonkey added this to the v2.7.10 milestone Jun 22, 2024
@droidmonkey droidmonkey merged commit dad8b1d into keepassxreboot:develop Jun 22, 2024
@droidmonkey droidmonkey added the pr: backported Pull request backported to previous release label Jul 1, 2024
@phoerious phoerious added pr: bugfix Pull request fixes a bug and removed bug labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: backported Pull request backported to previous release pr: bugfix Pull request fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backup file placeholders for time not working as expected
3 participants