]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - extlib/php-gettext/gettext.php
Commit upstream updates to php-gettext after the 1.0.7 release (but in 2006! :P)
[quix0rs-gnu-social.git] / extlib / php-gettext / gettext.php
index ad94a987b7e2e60cb71c321115108573bcf34e6a..cd080444ca0b782a1ec803145f165c815867400e 100644 (file)
@@ -102,16 +102,16 @@ class gettext_reader {
     // Caching can be turned off
     $this->enable_cache = $enable_cache;
 
-    // $MAGIC1 = (int)0x950412de; //bug in PHP 5
+    // $MAGIC1 = (int)0x950412de; //bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565
     $MAGIC1 = (int) - 1794895138;
     // $MAGIC2 = (int)0xde120495; //bug
     $MAGIC2 = (int) - 569244523;
 
     $this->STREAM = $Reader;
     $magic = $this->readint();
-    if ($magic == $MAGIC1) {
+    if ($magic == ($MAGIC1 & 0xFFFFFFFF)) { // to make sure it works for 64-bit platforms
       $this->BYTEORDER = 0;
-    } elseif ($magic == $MAGIC2) {
+    } elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) {
       $this->BYTEORDER = 1;
     } else {
       $this->error = 1; // not MO file