WordPress.org

Make WordPress Core

Opened 2 years ago

#40631 new defect (bug)

Safari issues with wp-includes/ms-files.php

Reported by: Brandicoot Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7.4
Component: General Keywords:
Focuses: multisite Cc:
PR Number:

Description

We have a multi-site network with over 200 sites on it.

Whilst the network is running WP 4.7.4–en_AU the network was originally built on a version prior to 3.5 and has been continually updated as versions become available. That being said, our network still uses the old file structure wp-content/blogs.dir/[site#]/files to store media. I've tried converting this over with no success and haven't really been able to find any good resources to help me do this beyond the things I've tried.

So, our network continues to use the above path with the compatibility option of using wp-includes/ms-files.php which is called in the .htaccess file.

However, there seems to be a bug in the ms-files.php that are causing some resources not to load properly when the sites are loaded into Safari or an iOS device.

  1. PDF documents fail to load
  2. CSS files that have been cached by our theme (it has it's own caching function) also fail to load.

I've narrowed down the culprit to the lines of code in ms-file.php that output the headers. If I comment out the code on line 43:

header( 'Content-Length: ' . filesize( $file ) );

...then the problem goes away. Not sure what impact commenting the above has but it doesn't seem to break the site so I've left it commented out.

My best guess is that Safari doesn't like this header being sent out separately from the earlier one on line 41. It may even be a bug with Safari - not sure on this one.

Anyway, thought I'd report it here to begin with.

Cheers
Chris

Change History (0)

Note: See TracTickets for help on using tickets.