splitfeed/android-market-api-php — Issue #11: creationTime is wrong when getting comments
Author: migprj
Created: 2011-12-28 12:19:45+00:00
State: open

At least in 32 bit systems the getCreationTime() method on a comment returns invalid values, sometimes even negative values!

I've altered the following code inside the file protocolbuffers.inc.php :

I've replaced:
$i = 0;
$shift = 0;
for ($j = 0; $j < $len; $j++) {
$i |= ((ord($value[$j]) & 0x7F) << $shift);
$shift += 7;
}
By:
$i = 0.0;
for ($j = $len-1; $j >= 0; $j--) $i = $i * 128 + (ord($value[$j]) & 0x7F);

Now the command date("Y-m-d H:i:s",$comment->getCreationTime()/1000) returns the correct date!