WordPress.org

Make WordPress Core

Opened 6 months ago

Closed 6 months ago

#46987 closed defect (bug) (fixed)

Return value of the get_dirsize function is the number of bytes

Reported by: tmatsuur Owned by: SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version: 5.2
Component: Filesystem API Keywords: has-patch
Focuses: docs Cc:
PR Number:

Description

In this doc of the get_dirsize function, the return value is MB.

 * @return int|false|null Size in MB if a valid directory. False if not. Null if timeout.

I tried on some directories, but the actual value returned was the number of bytes.
Is this doc correct?

Attachments (1)

46987.patch (797 bytes) - added by wpboss 6 months ago.

Download all attachments as: .zip

Change History (5)

@wpboss
6 months ago

#1 @wpboss
6 months ago

  • Keywords has-patch added

Yes @tmatsuur you are right. I have checked it and it always returns bytes. I have corrected that in function's documentation. Please let me know any more changes are required.

#2 @SergeyBiryukov
6 months ago

  • Component changed from General to Filesystem API
  • Milestone changed from Awaiting Review to 5.2

Introduced in [33184]. Fixed in [45220] for recurse_dirsize(), but not for get_dirsize().

#3 @SergeyBiryukov
6 months ago

  • Focuses docs added

#4 @SergeyBiryukov
6 months ago

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

In 45249:

Docs: Correct @return description for get_dirsize().

Props wpboss, tmatsuur.
Fixes #46987.

Note: See TracTickets for help on using tickets.