Reference passing fix from jsteidl. fixes #1676

git-svn-id: https://develop.svn.wordpress.org/trunk@2882 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-09-15 23:42:29 +00:00
parent 7d37efbbba
commit a766b9544b
1 changed files with 5 additions and 2 deletions

View File

@ -61,12 +61,15 @@ class gettext_reader {
* @return Integer from the Stream
*/
function readint() {
$stream = $this->STREAM->read(4);
if ($this->BYTEORDER == 0) {
// low endian
return array_shift(unpack('V', $this->STREAM->read(4)));
$unpacked = unpack('V',$stream);
return array_shift($unpacked);
} else {
// big endian
return array_shift(unpack('N', $this->STREAM->read(4)));
$unpacked = unpack('N',$stream);
return array_shift($unpacked);
}
}