[wp-trac] [WordPress Trac] #60678: Definition of WP_Translation_File_MO::MAGIC_MARKER

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


#60678: Definition of WP_Translation_File_MO::MAGIC_MARKER
------------------------------+-------------------------
 Reporter:  tmatsuur          |       Owner:  swissspidy
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  6.5
Component:  I18N              |     Version:  trunk
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:
------------------------------+-------------------------
Changes (by swissspidy):

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


Comment:

 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/60678#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list