[wp-trac] [WordPress Trac] #3780: gettext fails to determine byteorder on 64bit systems with php5.2.1

WordPress Trac noreply at wordpress.org
Mon Mar 4 15:52:28 UTC 2024


#3780: gettext fails to determine byteorder on 64bit systems with php5.2.1
---------------------------------------------------+---------------------
 Reporter:  abtime                                 |       Owner:  (none)
     Type:  defect (bug)                           |      Status:  closed
 Priority:  normal                                 |   Milestone:  2.3.3
Component:  I18N                                   |     Version:  2.2
 Severity:  critical                               |  Resolution:  fixed
 Keywords:  i18n has-patch commit 2.3.3-candidate  |
---------------------------------------------------+---------------------

Comment (by swissspidy):

 In [changeset:"57763" 57763]:
 {{{
 #!CommitTicketReference repository="" revision="57763"
 I18N: Cast magic MO marker number to integer.

 In gettext, `0x950412de` is used to signal GNU MO files. In
 `WP_Translation_File_MO` this magic marker is used to detect whether a
 file uses little endian or big endian.

 On 32 bit systems, this number will be interpreted by PHP as a float
 rather than an integer. This change adds extra casting to force an
 integer.

 A similar change was done in the pomo library in the past, see #3780.

 Props tmatsuur, swissspidy.
 Fixes #60678.
 }}}

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


More information about the wp-trac mailing list