summaryrefslogtreecommitdiff
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:51:23 -0700
commit77afd6c3448335b3a46c98c78fbbda733fc5d586 (patch)
tree631eca3a2ab5640e69c1e67b122b0c8c379ed6c7
parentbf4626ddf6362b81d1ce23a5cc300b4d5694c146 (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
-rw-r--r--extlib/php-gettext/ChangeLog16
-rw-r--r--extlib/php-gettext/gettext.inc6
-rw-r--r--extlib/php-gettext/gettext.php6
3 files changed, 22 insertions, 6 deletions
diff --git a/extlib/php-gettext/ChangeLog b/extlib/php-gettext/ChangeLog
index 5e0949dfd..ab77d8081 100644
--- a/extlib/php-gettext/ChangeLog
+++ b/extlib/php-gettext/ChangeLog
@@ -1,3 +1,19 @@
+2006-02-28 Danilo Šegan <danilo@gnome.org>
+
+ * gettext.php: Added some comments about these workarounds for
+ different PHP versions and architectures.
+
+2006-02-28 Danilo Šegan <danilo@gnome.org>
+
+ Fixes bug #15923.
+
+ * gettext.php (gettext_reader): make magic check work on 64-bit
+ platforms as well (by Steffen Pingel).
+
+2006-02-20 Danilo Šegan <danilo@gnome.org>
+
+ * gettext.inc (_bindtextdomain): Use php_uname to detect Windows.
+
2006-02-07 Danilo Šegan <danilo@gnome.org>
* examples/pigs_dropin.php: comment-out bind_textdomain_codeset
diff --git a/extlib/php-gettext/gettext.inc b/extlib/php-gettext/gettext.inc
index eb94b256a..fcaafe7c9 100644
--- a/extlib/php-gettext/gettext.inc
+++ b/extlib/php-gettext/gettext.inc
@@ -148,9 +148,9 @@ function _setlocale($category, $locale) {
*/
function _bindtextdomain($domain, $path) {
global $text_domains;
- // ensure $path ends with a slash
- if ($path[strlen($path) - 1] != '/') $path .= '/';
- elseif ($path[strlen($path) - 1] != '\\') $path .= '\\';
+ // ensure $path ends with a slash
+ if ($path[strlen($path) - 1] != '/') $path .= '/';
+ elseif ($path[strlen($path) - 1] != '\\') $path .= '\\';
$text_domains[$domain]->path = $path;
}
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