mirror of
https://github.com/danog/tg-file-decoder.git
synced 2024-11-30 04:38:58 +01:00
PHP 8.2 support
This commit is contained in:
parent
d7472df075
commit
1412739b5a
@ -474,7 +474,7 @@ function internalDecode(string $fileId): array
|
|||||||
$result['typeId'] &= ~FILE_REFERENCE_FLAG;
|
$result['typeId'] &= ~FILE_REFERENCE_FLAG;
|
||||||
$result['typeId'] &= ~WEB_LOCATION_FLAG;
|
$result['typeId'] &= ~WEB_LOCATION_FLAG;
|
||||||
if (!isset(TYPES[$result['typeId']])) {
|
if (!isset(TYPES[$result['typeId']])) {
|
||||||
throw new \InvalidArgumentException("Invalid file type provided: ${result['typeId']}");
|
throw new \InvalidArgumentException("Invalid file type provided: {$result['typeId']}");
|
||||||
}
|
}
|
||||||
$result['type'] = TYPES[$result['typeId']];
|
$result['type'] = TYPES[$result['typeId']];
|
||||||
$res = \fopen('php://memory', 'rw+b');
|
$res = \fopen('php://memory', 'rw+b');
|
||||||
@ -593,7 +593,7 @@ function internalDecodeUnique(string $fileId): array
|
|||||||
|
|
||||||
$result = \unpack('VtypeId', $fileId);
|
$result = \unpack('VtypeId', $fileId);
|
||||||
if (!isset(UNIQUE_TYPES[$result['typeId']])) {
|
if (!isset(UNIQUE_TYPES[$result['typeId']])) {
|
||||||
throw new \InvalidArgumentException("Invalid file type provided: ${result['typeId']}");
|
throw new \InvalidArgumentException("Invalid file type provided: {$result['typeId']}");
|
||||||
}
|
}
|
||||||
$result['type'] = UNIQUE_TYPES[$result['typeId']];
|
$result['type'] = UNIQUE_TYPES[$result['typeId']];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user