Avoid 32 bit issues

This commit is contained in:
Daniil Gentili 2020-10-06 21:02:28 +02:00
parent 226ddc68dc
commit 36fca79a3d
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -265,12 +265,15 @@ function fixLong(array &$params, string $field)
/** /**
* Encode long to string. * Encode long to string.
* *
* @param int|int[] $fields Fields to encode * @param string|int|int[] $fields Fields to encode
* *
* @return string * @return string
*/ */
function packLong($fields): string function packLong($fields): string
{ {
if (\is_string($fields)) { // Already encoded, we hope
return $fields;
}
if (PHP_INT_SIZE === 8) { if (PHP_INT_SIZE === 8) {
return \pack(LONG, $fields); return \pack(LONG, $fields);
} }