summaryrefslogtreecommitdiff
path: root/extlib/php-gettext/gettext.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2009-10-13 14:51:23 -0700
committerBrion Vibber <brion@pobox.com>2009-10-13 14:54:48 -0700
commitffeef6520c4e9e1d691bcea8a15aa8097ceb1d37 (patch)
treeb0618f04f8457f9dbfbb70d2cb21daea9a12b1ad /extlib/php-gettext/gettext.php
parent8be28f478dd578f1b8fca561238b9ee5a13c6b27 (diff)
Commit upstream updates to php-gettext after the 1.0.7 release (but in 2006! :P)
Fixes file magic checks on 64-bit systems. http://bazaar.launchpad.net/~danilo/php-gettext/trunk/revision/17 http://bazaar.launchpad.net/~danilo/php-gettext/trunk/revision/18 http://bazaar.launchpad.net/~danilo/php-gettext/trunk/revision/19
Diffstat (limited to 'extlib/php-gettext/gettext.php')
-rw-r--r--extlib/php-gettext/gettext.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/extlib/php-gettext/gettext.php b/extlib/php-gettext/gettext.php
index ad94a987b..cd080444c 100644
--- a/extlib/php-gettext/gettext.php
+++ b/extlib/php-gettext/gettext.php
@@ -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