1
0

[FIX] CRC could be wrong on 32 bits system

This commit is contained in:
Romain LE DISEZ 2010-11-24 06:20:02 +08:00 committed by Bharat Mediratta
parent 9ee5582ad4
commit 26f882091b

View File

@ -287,9 +287,13 @@ class downloadalbum_Controller extends Controller {
* See http://bugs.php.net/bug.php?id=45028
*/
private function fixBug45028($hash) {
return (version_compare(PHP_VERSION, '5.2.7', '<'))
? (($hash & 0x000000ff) << 24) + (($hash & 0x0000ff00) << 8)
+ (($hash & 0x00ff0000) >> 8) + (($hash & 0xff000000) >> 24)
: $hash;
$output = $hash;
if( version_compare(PHP_VERSION, '5.2.7', '<') ) {
$str = str_pad(dechex($hash), 8, '0', STR_PAD_LEFT);
$output = hexdec($str{6}.$str{7}.$str{4}.$str{5}.$str{2}.$str{3}.$str{0}.$str{1});
}
return $output;
}
}