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

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 22 20:52:57 GMT 2007


#3780: gettext fails to determine byteorder on 64bit systems with php5.2.1
---------------------------------------------+------------------------------
 Reporter:  abtime                           |        Owner:  anonymous
     Type:  defect                           |       Status:  new      
 Priority:  normal                           |    Milestone:  2.4      
Component:  i18n                             |      Version:  2.2      
 Severity:  critical                         |   Resolution:           
 Keywords:  i18n has-patch 2nd-opition test  |  
---------------------------------------------+------------------------------
Changes (by ophy):

 * cc: lapo at lapo.it (added)

Comment:

 (on the behalf of my friend lapo at lapo.it)

 On my 64 bit server, with release 2.3:
 {{{
 magic=ffffffff950412de
 MAGIC1=ffffffff950412de
 MAGIC2=ffffffffde120495
 MAGIC3=950412de
 }}}
 So the fix with MAGIC3 doesn't work and MAGIC1 would work if it was not
 truncated to 32bit itself.
 I've made it working with the following patch:

 {{{
 --- wp-includes/gettext.php.orig        Mon Oct 22 22:35:56 2007
 +++ wp-includes/gettext.php     Mon Oct 22 22:50:38 2007
 @@ -113,7 +113,7 @@
                 $MAGIC3 = (int) 2500072158;

                 $this->STREAM = $Reader;
 -               $magic = $this->readint();
 +               $magic = $this->readint() & 0xFFFFFFFF;

                 if ($magic == ($MAGIC1 & 0xFFFFFFFF) || $magic == ($MAGIC3
 & 0xFFFFFFFF)) { // to make sure it works for 64-bit platforms
                         $this->BYTEORDER = 0;
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3780#comment:18>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list