Make WordPress Core

Opened 12 years ago

Closed 10 years ago

#20522 closed enhancement (worksforme)

the sanitize_file_name_chars filter and ch(0)

Reported by: olivm's profile olivM Owned by:
Milestone: Priority: normal
Severity: minor Version:
Component: Formatting Keywords: needs-docs needs-unit-tests
Focuses: Cc:


the sanitize_file_name_chars filter is tricky to use due to the chr(0) ending the array :


special_chars[] = $my_char; 


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);


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

Change History (2)

#1 @SergeyBiryukov
12 years ago

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

#2 @nacin
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.