Opened 5 months ago
Last modified 5 months ago
#64767 new defect (bug)
Some PHP Warnings appears with PHP 8.5
| Reported by: | phil78180 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | General | Version: | 6.9.1 |
| Severity: | normal | Keywords: | php85 has-patch |
| Cc: | Focuses: |
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
@
5 months 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
patch file