[wp-trac] [WordPress Trac] #62995: Uploading Mac screenshots results in broken images, due to question marks inserted in filenames

WordPress Trac noreply at wordpress.org
Tue Jul 1 15:39:01 UTC 2025


#62995: Uploading Mac screenshots results in broken images, due to question marks
inserted in filenames
-------------------------------------------------+-------------------------
 Reporter:  room34                               |       Owner:  dmsnell
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.9
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  reporter-feedback has-patch has-     |     Focuses:
  unit-tests                                     |  administration
-------------------------------------------------+-------------------------
Changes (by dmsnell):

 * owner:  (none) => dmsnell
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"60399" 60399]:
 {{{
 #!CommitTicketReference repository="" revision="60399"
 sanitize_file_name(): Normalize all space characters to a space.

 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.

 Developed in https://github.com/wordpress/wordpress-develop/pull/9103
 Discussed in https://core.trac.wordpress.org/ticket/62995

 Props audrasjb, desrosj, dmsnell, jonsurrell, matt, room34, siliconforks,
 zieladam.
 Fixes #62995.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62995#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list