Files
wordpress/wp-includes/formatting.php
audrasjb e74c56757f Media: Normalize all space characters to a space in sanitize_file_name().
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.


Built from https://develop.svn.wordpress.org/branches/6.8@60411


git-svn-id: http://core.svn.wordpress.org/branches/6.8@59747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-07-05 06:35:32 +00:00

335 KiB