[wp-hackers] Quick question about sanitize_file_name

Nathaniel Taintor goldenapplesdesign at gmail.com
Fri Feb 17 20:53:20 UTC 2012


I've been trying to generate filenames for some uploaded files using
sanitize_file_name, and come across some weirdness when the string passed
to sanitize_file_name has curly quotes or apostrophes - they don't get
stripped out, which causes errors when using them as HTML entities.

Is this expected behaviour, or should the list of special characters be
expanded to include curly quotes?

Happy to open a trac ticket if its something overlooked... just wanted to
see if I'm doing something wrong first. (I worked around it by passing the
filename without extension through santizte_title_with_dashes, then adding
the extension and passing that through sanitize_file_name.)



Nathaniel Taintor, Designer/Developer
*Golden Apples Design*
http://goldenapplesdesign.com

@GoldenApples | 717.434.3226
goldenapplesdesign at gmail.com


More information about the wp-hackers mailing list