Skip to content

Fix: #5696, Do not convert unicode chars in filenames#6654

Merged
bdukes merged 3 commits intodnnsoftware:developfrom
mohamad-asghari:fix-issue-5696
Aug 19, 2025
Merged

Fix: #5696, Do not convert unicode chars in filenames#6654
bdukes merged 3 commits intodnnsoftware:developfrom
mohamad-asghari:fix-issue-5696

Conversation

@mohamad-asghari
Copy link
Copy Markdown
Contributor

Closes #5696

Summary

This pull request addresses the issue of file uploads failing when filenames contain Unicode characters, such as Farsi or Arabic.

The previous implementation used Utility.ConvertUnicodeChars, which incorrectly removed these characters from the filename, leading to upload failures.

This change replaces that flawed logic with a safer and more robust method:

  • It gets the original filename, including all Unicode characters.
  • It then sanitizes the filename by removing or replacing invalid characters using Path.GetInvalidFileNameChars() from the .NET framework.

This approach ensures that filenames with non-English characters are properly preserved while maintaining security against potential path traversal attacks. The fix is a direct and efficient solution that doesn't introduce any new dependencies.

@mohamad-asghari
Copy link
Copy Markdown
Contributor Author

mohamad-asghari commented Aug 13, 2025

@microsoft-github-policy-service agree

@mohamad-asghari
Copy link
Copy Markdown
Contributor Author

Hello,

I noticed that I don't have the permissions to set the Milestone and Labels for this pull request.

Could you please add the following:

  • Milestone: 10.1.1
  • Label: Type: Bug

Thank you for your help.

@bdukes bdukes added this to the 10.1.1 milestone Aug 13, 2025
@bdukes bdukes merged commit 846ad50 into dnnsoftware:develop Aug 19, 2025
3 checks passed
@mohamad-asghari mohamad-asghari deleted the fix-issue-5696 branch September 29, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Empty file names after uploading in ckeditor image upload

3 participants