[wp-trac] [WordPress Trac] #26094: sanitize_file_name() breaks some UTF-8 strings

WordPress Trac noreply at wordpress.org
Mon Sep 1 09:31:36 UTC 2014


#26094: sanitize_file_name() breaks some UTF-8 strings
----------------------------------------+-----------------------------
 Reporter:  p_enrique                   |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Future Release
Component:  Formatting                  |     Version:  2.1
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch commit 3.9-early  |     Focuses:
----------------------------------------+-----------------------------

Comment (by lenasterg):

 Hi.
 I just want to remind that the problem in sanitize_file_name for the
 (U+03A0) : Π Greek capital letter pi

 still exists in wordpress version 3.9.2
 It can be solved by replacing the

 {{{
 $filename = preg_replace( '/[\s-]+/' , '-' , $filename ) ;
 }}}

 with

 {{{
 $filename = preg_replace( '/[\s-]+/u' , '-' , $filename ) ;
 }}}

 but I can't be sure what side effects in has for other special cases.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26094#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list