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

Upload dialog: fix allowed characters for filename #6462

Merged

Conversation

distantnative
Copy link
Member

@distantnative distantnative commented May 26, 2024

This PR …

Consistent with change filename dialog:

'allow' => 'a-z0-9@._-',

Fixes

For review team

  • Add changes & docs to release notes draft in Notion

@distantnative distantnative added the type: bug 🐛 Is a bug; fixes a bug label May 26, 2024
@distantnative distantnative added this to the 4.3.0 milestone May 26, 2024
@distantnative distantnative requested a review from a team May 26, 2024 10:04
@distantnative distantnative self-assigned this May 26, 2024
@distantnative distantnative linked an issue May 26, 2024 that may be closed by this pull request
Consistent to `Str::slug()` on backend
@afbora
Copy link
Member

afbora commented May 29, 2024

@distantnative I found something . Could you check whether it's bug or not? I think there is an inconsistency about @ char.

  1. Select a file from files section
  2. Set filename as file.a@b_c-d in dialog before upload and upload it
  3. file.a@b_c-d.jpg files will be uploaded successfully and you'll see in section
  4. Try to rename the file with file.a@b_c-de (append just e)
  5. You will see that @ is gone as file.a-b-c-de.jpg

@distantnative distantnative added needs: tests 🧪 Requires missing tests needs: changes 🔁 Implement any requested changes to proceed labels May 29, 2024
@distantnative distantnative removed needs: tests 🧪 Requires missing tests needs: changes 🔁 Implement any requested changes to proceed labels May 30, 2024
@distantnative
Copy link
Member Author

@afbora Good catch. This was actually its own bug where $file->changeName() would apply F::safeName() even though passing the name string without extension. So when that name contained a ., F::safeName() would consider that the separator between base name and extension. Now using F::safeBasename().

@distantnative distantnative requested a review from a team May 30, 2024 20:27
@distantnative distantnative force-pushed the fix/6461-upload-dialog-allowed-characters branch from 635af85 to 98f5a0d Compare May 30, 2024 20:37
@distantnative distantnative merged commit 091ac5a into develop-minor Jun 1, 2024
14 checks passed
@distantnative distantnative deleted the fix/6461-upload-dialog-allowed-characters branch June 1, 2024 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filename sanitization rules are inconsistent
2 participants