﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
22363,Accents in attachment filenames should be sanitized,tar.gz,,"There is an inconsistency in the way WP is sanitizing post slugs and attachment filenames.

Sanitizing the post slugs is a Good Thing(tm) for non-english users who use diacritics in their post titles. 

Example: If I write a post with the title ""Moiré patterns"", the actual page slug will be: ""moire-patterns"". The space is replaced with a hyphen, the ""é"" becomes ""e"". Even if I try to change the slug manually into ""moiré"", WP won't let me (for my own good, since that URL would break in lesser capable browsers).

For some reason, WP doesn't apply that error-correction to attachment filenames. 

Example: If I attach a file named ""moiré pattern.png"", it gets renamed into ""moiré-pattern.png"".

We can see that the space (and some other forbidden characters) are corrected by `sanitize_file_name()`, but diacritics such as ""é"" or ""ä"" are left as they are.

Currently, most modern browsers are capable of displaying files with diacritics, but some of them still fail (most prominently, Safari).

For the sake of cross-browser compatibility, attachment filenames should benefit from the same safety measures that we apply for the post slugs (I guess that's the `remove_accents()` function).",defect (bug),new,normal,3.6,Upload,3.4,normal,,has-patch,code@… knut@…
