Skip to content

new and improved sanitize method#188

Open
guycalledseven wants to merge 1 commit intoverot:masterfrom
guycalledseven:master
Open

new and improved sanitize method#188
guycalledseven wants to merge 1 commit intoverot:masterfrom
guycalledseven:master

Conversation

@guycalledseven
Copy link

Fixes & Optimizations

✅ UTF-8 Transliteration

  • Converts šđčć.png → sdc.png (removes accents & special characters)
  • Uses transliterator_transliterate() (if available) or iconv() fallback.

✅ Handles Filename Length Properly

  • Uses mb_substr() to safely trim multibyte characters.

✅ Removes Double Extensions

  • Prevents filenames like file..png.

✅ Ensures a Safe Filename

  • Removes dangerous characters.
  • Keeps only ASCII, dots, dashes, and underscores.

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.

1 participant