mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 17:02:03 +02:00
MDL-75477 libraries: upgrade to version 1.11.0 of MaxMind.
This commit is contained in:
parent
8f492a836a
commit
5b38e187d9
@ -1,6 +1,14 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
1.11.0
|
||||
-------------------
|
||||
|
||||
* Replace runtime define of a constant to facilitate opcache preloading.
|
||||
Reported by vedadkajtaz. GitHub #134.
|
||||
* Resolve minor issue found by the Clang static analyzer in the C
|
||||
extension.
|
||||
|
||||
1.10.1 (2021-04-14)
|
||||
-------------------
|
||||
|
||||
|
@ -7,13 +7,6 @@ namespace MaxMind\Db\Reader;
|
||||
// @codingStandardsIgnoreLine
|
||||
use RuntimeException;
|
||||
|
||||
/*
|
||||
* @ignore
|
||||
*
|
||||
* We subtract 1 from the log to protect against precision loss.
|
||||
*/
|
||||
\define(__NAMESPACE__ . '\_MM_MAX_INT_BYTES', (int) ((log(\PHP_INT_MAX, 2) - 1) / 8));
|
||||
|
||||
class Decoder
|
||||
{
|
||||
/**
|
||||
@ -316,11 +309,11 @@ class Decoder
|
||||
|
||||
$integer = 0;
|
||||
|
||||
// PHP integers are signed. _MM_MAX_INT_BYTES is the number of
|
||||
// PHP integers are signed. PHP_INT_SIZE - 1 is the number of
|
||||
// complete bytes that can be converted to an integer. However,
|
||||
// we can convert another byte if the leading bit is zero.
|
||||
$useRealInts = $byteLength <= _MM_MAX_INT_BYTES
|
||||
|| ($byteLength === _MM_MAX_INT_BYTES + 1 && (\ord($bytes[0]) & 0x80) === 0);
|
||||
$useRealInts = $byteLength <= \PHP_INT_SIZE - 1
|
||||
|| ($byteLength === \PHP_INT_SIZE && (\ord($bytes[0]) & 0x80) === 0);
|
||||
|
||||
for ($i = 0; $i < $byteLength; ++$i) {
|
||||
$part = \ord($bytes[$i]);
|
||||
@ -344,7 +337,7 @@ class Decoder
|
||||
|
||||
private function sizeFromCtrlByte(int $ctrlByte, int $offset): array
|
||||
{
|
||||
$size = $ctrlByte & 0x1f;
|
||||
$size = $ctrlByte & 0x1F;
|
||||
|
||||
if ($size < 29) {
|
||||
return [$size, $offset];
|
||||
|
@ -24,7 +24,7 @@
|
||||
"ext-maxminddb": "<1.10.1,>=2.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "*",
|
||||
"friendsofphp/php-cs-fixer": "3.*",
|
||||
"phpunit/phpunit": ">=8.0.0,<10.0.0",
|
||||
"php-coveralls/php-coveralls": "^2.1",
|
||||
"phpunit/phpcov": ">=6.0.0",
|
||||
|
@ -413,7 +413,7 @@ All rights reserved.</copyright>
|
||||
<location>maxmind/MaxMind</location>
|
||||
<name>MaxMind DB Reader API</name>
|
||||
<description>PHP API for reading MaxMind DB files.</description>
|
||||
<version>1.10.1</version>
|
||||
<version>1.11.0</version>
|
||||
<license>Apache</license>
|
||||
<licenseversion>2.0</licenseversion>
|
||||
<repository>https://github.com/maxmind/MaxMind-DB-Reader-php/</repository>
|
||||
|
Loading…
x
Reference in New Issue
Block a user