Opened 2 years ago

Closed 2 years ago

#17256 closed defect (bug) (fixed)

Image-error in Multisite (subdir)

Reported by: dvwallin Owned by: ryan
Priority: normal Milestone: 3.2
Component: Multisite Version: 3.1
Severity: normal Keywords: has-patch
Cc:

Description

When setting up a multisite-network using subdirectory-method in Wordpress 3.1.x images get the wrong encoding and doesn't show up anywhere.

This is due to the header-setting being wrong in ms-files.php where, to solve the issue, you simply replace

header( 'Content-type: ' . $mimetype ); always send this

with

header("Content-Type: $mimetype"); always send this

Attachments (1)

patch_commit_2850cf365c47.patch (521 bytes) - added by dvwallin 2 years ago.

Download all attachments as: .zip

Change History (9)

  • Keywords has-patch removed

Those two lines of code are equivalent. The resulting string that's sent to the header() function is the same.

To test:

var_dump( 'Content-type: ' . $mimetype );

var_dump( "Content-Type: $mimetype" );
Last edited 2 years ago by scribu (previous) (diff)

I know but for some reason the later one worked and the first one did not.

No, something else has to be going on. Maybe you're testing different URLs.

Not at all. Been quite detailed in the tests. Changing that single line made the image-handling work throughout the multisite-setup. But i wont push for the patch. I'm using it and it works for me.

The difference isn't in the concatenation method, it's the capitalisation of 'Type'.

I couldn't reproduce the issue, but some searching does suggest that some badly written applications may expect Content-Type only.

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.2
  • Severity changed from blocker to normal

Ha, I knew it was something else. Thanks, kawauso.

comment:7   ryan2 years ago

We use Content-Type everywhere else, might as well be consistent.

comment:8   ryan2 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [17922]:

s/Content-type/Content-Type/. Props dvwallin. fixes #17256

Note: See TracTickets for help on using tickets.