[FIX] CRC could be wrong on 32 bits system
This commit is contained in:
parent
9ee5582ad4
commit
26f882091b
@ -287,9 +287,13 @@ class downloadalbum_Controller extends Controller {
|
|||||||
* See http://bugs.php.net/bug.php?id=45028
|
* See http://bugs.php.net/bug.php?id=45028
|
||||||
*/
|
*/
|
||||||
private function fixBug45028($hash) {
|
private function fixBug45028($hash) {
|
||||||
return (version_compare(PHP_VERSION, '5.2.7', '<'))
|
$output = $hash;
|
||||||
? (($hash & 0x000000ff) << 24) + (($hash & 0x0000ff00) << 8)
|
|
||||||
+ (($hash & 0x00ff0000) >> 8) + (($hash & 0xff000000) >> 24)
|
if( version_compare(PHP_VERSION, '5.2.7', '<') ) {
|
||||||
: $hash;
|
$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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user