[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
Thu Feb 20 23:14:23 UTC 2025


#62995: Uploading Mac screenshots results in broken images, due to question marks
inserted in filenames
--------------------------------+-----------------------------
 Reporter:  room34              |      Owner:  (none)
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Media               |    Version:  6.7.2
 Severity:  normal              |   Keywords:
  Focuses:  ui, administration  |
--------------------------------+-----------------------------
 macOS 15 Sequoia (and possibly earlier versions) uses a special character,
 rather than a regular ASCII space, in screenshot filenames, between the
 time and the AM/PM. For instance:

 `Screenshot 2025-02-19 at 2.17.33 PM.png`

 It may get lost here, but the character before PM in that filename is not
 a regular space. I ran the filename text string through a hex converter,
 and it identified it as the Unicode [the narrow no-break
 space](https://www.fileformat.info/info/unicode/char/202f/index.htm)
 (U+202F).

 The problem is, when uploading a file with that type of filename (tested
 in both Safari and Firefox), the WordPress function that standardizes
 Media Library filenames converts that character into a question mark,
 rather than a hyphen.

 For obvious reasons, there should never be a question mark in filenames in
 the Media Library. The result is of course that the browser interprets the
 part after the question mark as a query string, and now the URL is
 requesting a non-existent file, causing a broken image on the page.

 The attached screenshot shows the filename with a question mark after
 uploading the image to the Media Library.

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


More information about the wp-trac mailing list