Commit f41ae1e
committed
Media: Normalize all space characters to a space in
The `sanitize_file_name()` function normalizes the no-break space to a normal space (`U+0020`) in order to prevent issues saving files with the no-break space in it.
This patch expands the replacement to all space characters, since it’s known that macOS stores a `NARROW NO-BREAK SPACE` (`U+202F`) in screenshot filenames between the time and the am/pm indicator.
There are deeper issues with the way this function works, but this patch resolves a known and common problem without raising any of the deeper refactoring questions.
Reviewed by audrasjb, youknowriad.
Merges [60399] to the 6.8 branch.
Props audrasjb, desrosj, dmsnell, jonsurrell, matt, room34, siliconforks, zieladam, annezazu.
Fixes #62995.
git-svn-id: https://develop.svn.wordpress.org/branches/6.8@60411 602fd350-edb4-49c9-b593-d223f7449a82sanitize_file_name().1 parent 6edaddb commit f41ae1e
File tree
2 files changed
+19
-5
lines changed- src/wp-includes
- tests/phpunit/tests/formatting
2 files changed
+19
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2035 | 2035 | | |
2036 | 2036 | | |
2037 | 2037 | | |
2038 | | - | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
2039 | 2049 | | |
2040 | 2050 | | |
2041 | 2051 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
0 commit comments