fix(author): sanitize special characters from output filenames
Extended sanitizeForPath to remove additional special characters:
- Apostrophes (')
- Double quotes (")
- Backticks (`)
- Exclamation marks (!)
- Question marks (?)
- Ampersands (&) → "and"
Before: ifuckedmybestfriend'sgirlfriend.iso
After: ifuckedmybestfriendsgirlfriend.iso
This prevents filesystem issues and improves filename compatibility
across different operating systems and file sharing platforms.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
8c0f182262
commit
fb90d17304
|
|
@ -154,7 +154,24 @@ func buildUpscaleFilter(targetWidth, targetHeight int, method string, preserveAs
|
||||||
|
|
||||||
// sanitizeForPath creates a simple slug for filenames from user-visible labels
|
// sanitizeForPath creates a simple slug for filenames from user-visible labels
|
||||||
func sanitizeForPath(label string) string {
|
func sanitizeForPath(label string) string {
|
||||||
r := strings.NewReplacer(" ", "", "(", "", ")", "", "×", "x", "/", "-", "\\", "-", ":", "-", ",", "", ".", "", "_", "")
|
r := strings.NewReplacer(
|
||||||
|
" ", "",
|
||||||
|
"(", "",
|
||||||
|
")", "",
|
||||||
|
"×", "x",
|
||||||
|
"/", "-",
|
||||||
|
"\\", "-",
|
||||||
|
":", "-",
|
||||||
|
",", "",
|
||||||
|
".", "",
|
||||||
|
"_", "",
|
||||||
|
"'", "",
|
||||||
|
"\"", "",
|
||||||
|
"`", "",
|
||||||
|
"!", "",
|
||||||
|
"?", "",
|
||||||
|
"&", "and",
|
||||||
|
)
|
||||||
return strings.ToLower(r.Replace(label))
|
return strings.ToLower(r.Replace(label))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user