"Fixes #4420, i18n does not parse .mo files on 64bit Mac"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6622 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2008-04-02 18:36:19 +00:00
parent 82cd036672
commit c9a6fa7f9f

View file

@ -387,7 +387,7 @@ class I18n extends Object {
$header = unpack("L1magic/L1version/L1count/L1o_msg/L1o_trn", $header); $header = unpack("L1magic/L1version/L1count/L1o_msg/L1o_trn", $header);
extract($header); extract($header);
if (($magic == (-1794895138 & 0xFFFFFFFF) || $magic == (2500072158 & 0xFFFFFFFF)) && $version == 0) { if ((dechex($magic) == '950412de' || dechex($magic) == 'ffffffff950412de') && $version == 0) {
for ($n = 0; $n < $count; $n++) { for ($n = 0; $n < $count; $n++) {
$r = unpack("L1len/L1offs", substr($data, $o_msg + $n * 8, 8)); $r = unpack("L1len/L1offs", substr($data, $o_msg + $n * 8, 8));
$msgid = substr($data, $r["offs"], $r["len"]); $msgid = substr($data, $r["offs"], $r["len"]);
@ -405,7 +405,7 @@ class I18n extends Object {
$_this->__domains[$_this->category][$domain][$msgid] = $msgstr; $_this->__domains[$_this->category][$domain][$msgid] = $msgstr;
if (isset($msgid_plural)) { if (isset($msgid_plural)) {
$_this->__domains[$_this->category][$domain][$msgid_plural] = &$_this->__domains[$_this->category][$domain][$msgid]; $_this->__domains[$_this->category][$domain][$msgid_plural] =& $_this->__domains[$_this->category][$domain][$msgid];
} }
} }
} }