[wp-trac] [WordPress Trac] #21181: simplify and add filter to is_upload_space_available

WordPress Trac wp-trac at lists.automattic.com
Fri Aug 3 02:07:57 UTC 2012


#21181: simplify and add filter to is_upload_space_available
-------------------------+-----------------------
 Reporter:  jkudish      |       Owner:  westi
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  3.5
Component:  Multisite    |     Version:  3.4.1
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+-----------------------

Comment (by SergeyBiryukov):

 Replying to [comment:13 Jayjdk]:
 > One of my sites currently use 1.84 MB of space but after this commit,
 the dashboard says that is using 1930466 MB

 Confirmed. Moreover, on `media-new.php` I get "Sorry, you have used all of
 your storage quota of 10 MB", though I've only uploaded a single 424 KB
 image.

 There's currently an inconsistency between the expected and actual
 results:

 * `get_space_allowed()` returns megabytes.
 * `get_space_used()` returns bytes.
 * `wp_dashboard_quota()`, `get_upload_space_available()`,
 `upload_is_user_over_quota()`, and `display_space_usage()` expect
 `get_space_used()` to return megabytes.

 [attachment:21181.3.patch] fixes the inconsistency and adds missing
 PHPDocs.

 P.S. `display_space_usage()` was introduced in
 [http://mu.trac.wordpress.org/changeset/1069 mu:1069] (MU 1.3) and altered
 in [http://mu.trac.wordpress.org/changeset/1071 mu:1071], but is unused
 since [http://mu.trac.wordpress.org/changeset/1272 mu:1272] (MU 1.5.1) and
 can probably be deprecated.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21181#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list