ryanb / letter_opener

Preview mail in the browser instead of sending.
MIT License
3.73k stars 238 forks source link

Allow underscore and hyphen in attachment name #122

Closed stevenharman closed 8 years ago

stevenharman commented 8 years ago

Underscore and hyphen are both valid characters for a file name. Changing hyphens to underscore caused a good deal of confusion when letter_opener renamed the downloaded file. It makes good sense to strip other problematic characters, but we had an attachment with a simple and valid name, and it was being renamed. Our confusion was furthered by - becoming _ as we assumed it was a fat-finger error in our code.

This PR allows those two word separator characters (often used in Ruby land) to remain untouched.

nashby commented 8 years ago

@stevenharman thank you! Totally makes sense. :heart: