#60364 closed defect (bug) (fixed)
Incorrect argument type given on number_format
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.7 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Site Health | Keywords: | has-patch |
| Focuses: | Cc: |
Description (last modified by )
Argument #1 ($num) must be of type float, string given in /var/www/src/wp-admin/includes/class-wp-debug-data.php:587
Change History (10)
#2
@
2 years ago
Sorry for the wrong line number.
here's the MR link - βhttps://github.com/WordPress/wordpress-develop/pull/5960
#3
in reply to:
βΒ 1
;
follow-up:
βΒ 8
@
2 years ago
Replying to audrasjb:
Hello, welcome to WordPress Core Trac and thank you for opening this ticket,
Could you please specify the exact function where the issue is located?
L587 doesn't correspond to your issue: βhttps://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-admin/includes/class-wp-debug-data.php#L587
Thanks
Now I understand why my PR wasn't linked here. I am sorry for troubling you, it seems my github account has a bug, which I probably need to report with Github support team.
These were my changes: βhttps://ibb.co/59HWPjJ
Unfortunately, you may not able to see my MR.
#4
@
2 years ago
- Description modified (diff)
The PR proposes to run floatval() within number_format() on βline 585:
'value' => number_format( floatval( $max_file_uploads ) ),
- Should this test use
number_format_i18n()instead ofnumber_format()? - Could it use
(float)instead offloatval()? - Would it be better to assign the type when setting the variable?
$max_file_uploads = (float) ini_get( 'max_file_uploads' );
The test was added in [48535].
#5
@
17 months ago
- Milestone changed from Awaiting Review to 6.7
Hi there, welcome to WordPress Trac! Thanks for the ticket.
I was able to reproduce the issue with the strict_types PHP setting turned on.
Since the goal of the Site Health Info screen is to display raw values where possible, I believe we can just remove the number_format() call here, as the other values in the same section, e.g. file_uploads, post_max_size, or upload_max_filesize are displayed as is.
Hello, welcome to WordPress Core Trac and thank you for opening this ticket,
Could you please specify the exact function where the issue is located?
L587 doesn't correspond to your issue: βhttps://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-admin/includes/class-wp-debug-data.php#L587
Thanks