[wp-trac] [WordPress Trac] #59116: Integer Casting Error in WP_Site_Health::get_test_available_updates_disk_space() wordpress

WordPress Trac noreply at wordpress.org
Thu Aug 17 11:16:23 UTC 2023


#59116: Integer Casting Error in
WP_Site_Health::get_test_available_updates_disk_space() wordpress
--------------------------+-----------------------------
 Reporter:  mathsgrinds   |       Owner:  SergeyBiryukov
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  6.3.1
Component:  Site Health   |     Version:  6.3
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"56401" 56401]:
 {{{
 #!CommitTicketReference repository="" revision="56401"
 Site Health: Correct the check for disk space available to safely perform
 updates.

 If the available disk space exceeds the `PHP_INT_MAX` value, i.e. a 32-bit
 PHP version is in use with more than 2 GB free, the type casting to
 `(int)` could cause an overflow, and the Site Health test would then
 erroneously report that there is not enough free space.

 This commit removes the unnecessary type casting and uses the result from
 `disk_free_space()` directly.

 Includes optimizing the logic to skip further checks if the available disk
 space could not be determined.

 Follow-up to [55720].

 Props mathsgrinds, Presskopp, rajinsharwar, SergeyBiryukov.
 Fixes #59116.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59116#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list