[wp-trac] [WordPress Trac] #20522: the sanitize_file_name_chars filter and ch(0)

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 23 08:26:28 UTC 2012


#20522: the sanitize_file_name_chars filter and ch(0)
-------------------------+-----------------------------------------
 Reporter:  olivM        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Formatting   |    Version:
 Severity:  minor        |   Keywords:  needs-docs needs-unit-tests
-------------------------+-----------------------------------------
 the sanitize_file_name_chars filter is tricky to use due to the chr(0)
 ending the array :

 both
 {{{
 special_chars[] = $my_char;
 }}}
 and
 {{{
 array_push($special_chars, $mychar);
 }}}
 have no effect.

 so the only way to add some char to the array is to use array_unshift :
 {{{
 array_unshift($special_chars, $mychar);
 }}}

 adding

 this is mostly a php issue, but it could be useful to add some notice to
 the WordPress documentation.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20522>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list