Simbiat / filename-sanitizer

Sanitizes filenames to replace some restricted characters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Filename sanitizer

Small class to replace restricted characters or combinations in filenames. Based on rules for Windows https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file but will be useful for *NIX systems as well.

This will also replace some characters, that may be harmful depending on where and how the files are used. If you want to disable that behaviour, call the sanitize function with second argument as false.

If you want to remove the characters/combinations instead of replacing, send true as third argument.

About

Sanitizes filenames to replace some restricted characters

License:GNU Affero General Public License v3.0


Languages

Language:PHP 100.0%