WordPress.org

Make WordPress Core

Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#23588 closed defect (bug) (duplicate)

Specific character in file name breaks everything

Reported by: alexvorn2 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Filesystem API Keywords:
Focuses: Cc:

Description

How to replicate:

1) create an image with file name "aaa › bbb.jpg" (without brackets)

2) insert image into the editor

3) no image is shown

the file name is changed to "aaa-›-bbb.png", should be different.

The solution ( I think ) is to use url encode functions where is needed.

[ Using xamp + windows 7 32bit ]

Change History (6)

comment:1 alexvorn214 months ago

update:

The uploaded file name ( in the upload directory ) is "aaa-›-bbb.png", should be "aaa%20%E2%80%BA%20bbb.jpg"...

Version 0, edited 14 months ago by alexvorn2 (next)

comment:2 follow-up: SergeyBiryukov14 months ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version 3.5.1 deleted

Duplicate of #15955.

comment:3 in reply to: ↑ 2 ; follow-up: alexvorn214 months ago

Replying to SergeyBiryukov:

Duplicate of #15955.

Thanks!

It's sad that 2 years took and no fix was added to the trac, maybe the problem is in the Windows itself, who knows...

comment:4 in reply to: ↑ 3 ; follow-up: SergeyBiryukov14 months ago

Replying to alexvorn2:

It's sad that 2 years took and no fix was added to the trac, maybe the problem is in the Windows itself, who knows...

On Windows, there's no way to tell PHP that we use UTF-8 in file names (see ticket:15955:11). Some kind of conversion needs to be done.

comment:5 in reply to: ↑ 4 alexvorn214 months ago

Replying to SergeyBiryukov:

Replying to alexvorn2:

It's sad that 2 years took and no fix was added to the trac, maybe the problem is in the Windows itself, who knows...

On Windows, there's no way to tell PHP that we use UTF-8 in file names (see ticket:15955:11). Some kind of conversion needs to be done.

Maybe you are right, but here a simple fix is to encode file name with urlencode php function...

comment:6 alexvorn214 months ago

Created a screencast for this ticket...

Fixed the bug replacing the character with the encoded form of the character:
Double encoding for displaying on the webpage, single encoding for file name...

http://www.youtube.com/watch?v=De65PocUeMY

Note: See TracTickets for help on using tickets.