probo
probo copied to clipboard
Extract file name sanitization and use it everywhere
Create a single reusable file name sanitization function and replace all existing sanitization logic in the backend with it.
Steps to complete the issue:
Locate all current file name sanitization code in the backend. Extract that logic into a shared helper, for example: func SanitizeFileName(name string) string { // remove invalid characters, trim spaces, enforce safe extensions } Replace all direct sanitization code with calls to this helper. Add unit tests to verify consistent behavior. This ensures uniform file name handling across the entire backend.