Disabling filename sanitizing
-
I’ve been struggling with this for about 5 hours now to no avail. No matter what I do, whenever I upload a file the filename gets sanitized for me. In particular all periods except for the last one get removed. This breaks files with two-part extensions. (e.g. ‘.tar.gz’)
Looking through the code, I found 3 possible suspects:
sanitize_file_name in formatting.php
I’ve tried just removing the period replacement code, as well as commenting out the entire function only leaving ‘return $name’, to no avail.mw_newMediaObject in xmlrpc.php
I’ve tried taking out the sanitize_file_name call altogether, with no luck.clean_url in formatting.php
On a whim, I also tried removing the period from the first preg_replace line in clean_url, with no luck. (This actually caused some strange behavior during uploads.)So how can I prevent WP from removing periods from my uploads?!
- The topic ‘Disabling filename sanitizing’ is closed to new replies.