Opened 13 years ago
Closed 11 years ago
#20522 closed enhancement (worksforme)
the sanitize_file_name_chars filter and ch(0)
Reported by: | olivM | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | |
Component: | Formatting | Keywords: | needs-docs needs-unit-tests |
Focuses: | 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 (2)
Note: See
TracTickets for help on using
tickets.
I can't reproduce the issue in PHP 5.2.14 or 5.3.3 (Windows). The first two options seem to work fine.