Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#23588 closed defect (bug) (duplicate)

Specific character in file name breaks everything

Reported by: alexvorn2's profile 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)

#1 @alexvorn2
11 years ago

update:

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

Last edited 11 years ago by alexvorn2 (previous) (diff)

#2 follow-up: @SergeyBiryukov
11 years 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.

#3 in reply to: ↑ 2 ; follow-up: @alexvorn2
11 years 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...

#4 in reply to: ↑ 3 ; follow-up: @SergeyBiryukov
11 years 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.

#5 in reply to: ↑ 4 @alexvorn2
11 years 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...

#6 @alexvorn2
11 years 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.