Opened 6 weeks ago
Last modified 6 weeks ago
#64767 new defect (bug)
Some PHP Warnings appears with PHP 8.5
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 6.9.1 |
| Component: | General | Keywords: | php85 has-patch |
| Focuses: | Cc: |
Description
class WP_Translation_File_MO, lines 70 and 75 :
[01-Mar-2026 15:23:31 UTC] PHP Warning: The float 2500072158 is not representable as an int, cast occurred in D:\SITES_WEB\Gexprod\Site\wp-includes\l10n\class-wp-translation-file-mo.php on line 70
[01-Mar-2026 15:23:33 UTC] PHP Warning: The float 2500072158 is not representable as an int, cast occurred in D:\SITES_WEB\Gexprod\Site\wp-includes\l10n\class-wp-translation-file-mo.php on line 75
Attachments (1)
Change History (3)
#1
@
6 weeks ago
- Keywords has-patch added
I18N: Prevent PHP 8.5 float-to-int warnings in WP_Translation_File_MO.
On PHP 8.5+, large unsigned 32-bit integers returned by unpack() may be represented as floats on some platforms. Subsequent implicit casting can trigger warnings such as:
"The float 2500072158 is not representable as an int, cast occurred"
This patch introduces a helper method to normalize unpacked uint32 values and applies it to header and entry offsets before comparisons and arithmetic operations.
This ensures consistent unsigned 32-bit handling and prevents float-to-int casting warnings while maintaining existing behavior on both 32-bit and 64-bit platforms.
patch file