Opened 13 months ago

Last modified 13 months ago

#20522 new enhancement

the sanitize_file_name_chars filter and ch(0)

Reported by: olivM Owned by:
Priority: normal Milestone: Awaiting Review
Component: Formatting Version:
Severity: minor Keywords: needs-docs needs-unit-tests
Cc:

Description

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.

Change History (1)

I can't reproduce the issue in PHP 5.2.14 or 5.3.3 (Windows). The first two options seem to work fine.

Note: See TracTickets for help on using tickets.