Make WordPress Core

Opened 10 years ago

Closed 5 years ago

#28239 closed enhancement (fixed)

Unify size format display

Reported by: johnbillion's profile johnbillion Owned by: pento's profile pento
Milestone: 5.3 Priority: normal
Severity: normal Version: 2.3
Component: Formatting Keywords: has-patch
Focuses: Cc:

Description

#25643 replaced a couple of buggy blocks of code with calls to size_format().

There are some other places where we can use size_format() instead of manually constructing strings with file size units in them.

Patch coming up.

Attachments (1)

28239.diff (641 bytes) - added by pento 5 years ago.

Download all attachments as: .zip

Change History (7)

#1 @wonderboymusic
10 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 4.0

Looks like only display_space_usage() - let's patch it up

#2 @jacklenox
10 years ago

One problem here is that get_space_allowed() (used by display_space_usage()) retrieves the space allowed in megabytes, whereas size_format() converts a given number of bytes.

So in order to get this to work, we need to multiply the given figure by 1 million (roughly), which feels a bit hackish.

Or we could change the way get_space_allowed() works, but that's tied into the mu blog option: blog_upload_space, which is also in megabytes.

#3 @helen
10 years ago

  • Milestone changed from 4.0 to Future Release

No patch, punting. johnbillion, not sure if you still have a patch lying around.

#4 @chriscct7
9 years ago

  • Severity changed from minor to normal

@pento
5 years ago

#5 @pento
5 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone set to 5.3
  • Owner set to pento
  • Status changed from new to assigned

28239.diff changes display_space_usage() to use size_format().

#6 @pento
5 years ago

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

In 45579:

Multisite: Use size_format() in display_space_usage().

Deleted code is the best code.

Fixes #28239.

Note: See TracTickets for help on using tickets.