WordPress.org

Make WordPress Core

Opened 7 months ago

Last modified 7 months ago

#22694 new defect (bug)

Uploading File with Apostrophe in filename

Reported by: ianatkins Owned by:
Priority: normal Milestone: Awaiting Review
Component: Media Version: 3.4.2
Severity: normal Keywords:
Cc:

Description

When uploading a file with an apostrophe in the filename wordpress returns a 'HTTP Error' message.

I have replicated this on two separate installs of wordpress, on different LAMP hosting environments.

The filename used for testing was Trend_Forecaster's_Handbook_1.jpg

Change History (5)

comment:1 dd327 months ago

#22695 was marked as a duplicate.

comment:2 follow-up: pavelevap7 months ago

Tested in trunk and file is uploaded, but name is crippled: "s_Handbook_1.jpg"

comment:3 in reply to: ↑ 2 SergeyBiryukov7 months ago

Replying to pavelevap:

Tested in trunk and file is uploaded, but name is crippled: "s_Handbook_1.jpg"

Confirmed. Not a new bug though, tested 2.0.11 and it's the same there.

This is what $_FILES looks like:

Array
(
    [async-upload] => Array
        (
            [name] => s_Handbook_1.jpg
            [type] => image/jpeg
            [tmp_name] => S:\tmp\phpCB2.tmp
            [error] => 0
            [size] => 16658
        )

)

Appears to be a PHP bug: https://bugs.php.net/bug.php?id=31398

comment:4 SergeyBiryukov7 months ago

The workaround is to disable magic_quotes_gpc.

comment:5 ianatkins7 months ago

Thanks for investigating Sergey. Is it possible to catch this earlier and throw a more useful error message to the end user?

Note: See TracTickets for help on using tickets.