Skip to content

Sanitise filenames in UploadAction#273

Merged
mzur merged 3 commits into
mzur:masterfrom
medienbaecker:master
Oct 2, 2025
Merged

Sanitise filenames in UploadAction#273
mzur merged 3 commits into
mzur:masterfrom
medienbaecker:master

Conversation

@medienbaecker

Copy link
Copy Markdown
Contributor

Fixes filenames with special characters (like +) that break the Panel by using Kirby's F::safeName() method, consistent with how Kirby handles uploads in the Panel itself.

Closes #272.

@mzur mzur left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you please also add a test case for this? Here is an example.

@medienbaecker

Copy link
Copy Markdown
Contributor Author

I've added a test for the new feature, inspired by your existing tests (first time writing tests for me!).

I've also declared the $dir and $form properties to fix PHP 8.2+ deprecation warnings about dynamic properties. These properties are used in setUp() and in the existing tests. Without the declarations I got "Creation of dynamic property is deprecated" errors.

Let me know if this is all correct and thanks for your work on this great plugin.

@mzur mzur left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread tests/Actions/UploadActionTest.php Outdated
@mzur mzur merged commit f42394d into mzur:master Oct 2, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sanitise filenames in UploadAction

2 participants