WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#13601 closed defect (bug) (fixed)

Multi-Site -> Media: Incorrect Max Upload Size

Reported by: brandondove Owned by: nacin
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.0
Component: Media Keywords: has-patch
Focuses: Cc:

Description

"Maximum upload file size" value in the add media box is being pulled from the Network Options->Site upload space even when it's unchecked. Seems like it shouldn't show the restriction or instead show the php ini value in this scenario.

Attachments (3)

Screen shot 2010-05-28 at 11.32.56 AM.png (7.6 KB) - added by brandondove 4 years ago.
Shows unchecked "Site upload space" option
Screen shot 2010-05-28 at 11.33.20 AM.png (23.4 KB) - added by brandondove 4 years ago.
Shows the incorrect results in the media upload thickbox
13601.diff (521 bytes) - added by greuben 3 years ago.

Download all attachments as: .zip

Change History (22)

brandondove4 years ago

Shows unchecked "Site upload space" option

brandondove4 years ago

Shows the incorrect results in the media upload thickbox

comment:1 wpmuguru4 years ago

  • Keywords reporter-feedback added
  • Owner set to wpmuguru
  • Status changed from new to accepted

Are you using the RC?

comment:2 wpmuguru4 years ago

  • Resolution set to invalid
  • Status changed from accepted to closed

I tested with the RC and got the PHP file size limit. If you have the issue with the RC, please re-open and include what your netowrk options & PHP settings are.

comment:3 nacin4 years ago

  • Milestone 3.0 deleted

comment:4 mture4 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

I have come across the same issue with my WordPress 3.0.1 installation.

My PHP settings (from php.ini) are:

post_max_size = 200M
upload_max_filesize = 200M

My WordPress Network Options -> Upload Settings are:

Site upload space: unchecked, 10MB
Max upload file size: 204800KB

With these settings, the Maximum upload file size hint message in the Add an Image dialog box will display a max size of 10MB.

If I change the value of Site upload space to 5000MB (still unchecked), then the hint message will correctly show a max size of 200MB, reflecting the PHP limits.

comment:5 mture4 years ago

  • Cc mture added

Adding myself to the 'cc' list.

comment:6 sillybean4 years ago

  • Cc steph@… added

comment:7 sillybean4 years ago

I just encountered this as well in a nightly build from a few weeks ago. I forget which one; the db version is 15477.

post_max_size = 150M
upload_max_filesize = 150M

Site upload space: unchecked, 10MB
Max file upload size: 150000KB

The uploader screens all showed (and enforced) a 10MB limit until I increased the site upload space value, leaving it unchecked.

comment:8 hakre4 years ago

What does the "unchecked" mean? That the site upload space should be reflected in the limit?

comment:9 sillybean4 years ago

hakre, if that option is not checked, I would expect that the limit in the text input would not be enforced -- in other words, that there would be no upload limit specific to WordPress, and the php.ini settings would be used instead.

comment:10 nacin3 years ago

  • Keywords needs-patch added; media multisite reporter-feedback removed
  • Milestone set to 3.1

comment:11 wpmuguru3 years ago

If the space limit for a specific sub-site is 20MB, then the upload limit in the uploader should enforce that even if the PHP limit is higher. Otherwise, the setting is misleading.

A use case would be a network where default limit is 20MB & the user can purchase an upgrade to 2GB. In this scenario, the network admin might want to allow a full 2GB upload for the upgraded accounts and set the PHP limit accordingly. Without the individual sub-site setting, the network admin has no easy way to enforce the lower limit.

comment:12 nacin3 years ago

Going to try to review this today. If I don't fix it, or have a chance to review it, I am punting it.

If you care about this bug, please review it and look into it. I will otherwise very likely punt it.

greuben3 years ago

comment:13 greuben3 years ago

  • Keywords has-patch added; needs-patch removed

comment:14 ryan3 years ago

  • Milestone changed from 3.1 to Future Release

Punting all tickets that are not regressions in 3.1.

comment:15 nacin3 years ago

  • Milestone changed from Future Release to 3.1

This is a 3.0 regression (might have been in MU but I don't think so). The fix is small enough that Ryan can go for it. Moving back to 3.1 for now.

comment:16 nacin3 years ago

  • Owner changed from wpmuguru to nacin
  • Status changed from reopened to accepted

comment:17 sillybean3 years ago

Patch tested, works beautifully.

comment:18 wpmuguru3 years ago

That patch looks fine for me. With it applied, the uploader still observed either the PHP max size or the upload max size in the network settings (whichever was smaller).

comment:19 nacin3 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [17085]) Don't check the upload space site option if the option is disabled. props greuben, fixes #13601.

Note: See TracTickets for help on using tickets.