Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: MaxBackups not working since glob pattern is invalid #15780

Closed
KevinSleegers opened this issue Sep 23, 2024 · 1 comment
Closed

[4.x]: MaxBackups not working since glob pattern is invalid #15780

KevinSleegers opened this issue Sep 23, 2024 · 1 comment

Comments

@KevinSleegers
Copy link

KevinSleegers commented Sep 23, 2024

What happened?

Description

The glob pattern to grab the existing backups is invalid on lines 301 and 302 in src/db/Connection.php. The problem is that it contains 2 periods since $this->_getDumpExtension() also starts with a period. This results in [PROJECT]/storage/backups/*..sql and [PROJECT]/storage/backups/*..sql.zip by default.

Expected behavior

The set number of backups based on maxBackups should be respected and older backups should be deleted.

Actual behavior

No database backups are removed since $files is always an empty array due to the invalid glob pattern.

Craft CMS version

4.10.4

PHP version

8.3.11

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@KevinSleegers KevinSleegers changed the title [4.x]: MaxBackups [4.x]: MaxBackups pattern check invalid Sep 23, 2024
@KevinSleegers KevinSleegers changed the title [4.x]: MaxBackups pattern check invalid [4.x]: MaxBackups not working since glob pattern is invalid Sep 23, 2024
@brandonkelly
Copy link
Member

Thanks for reporting that! Craft 4.12.4 and 5.4.5 are out with a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants