Skip to content

Commit

Permalink
Merge pull request #56 from laminas/2.17.x-merge-up-into-3.0.x_lHwJWtXn
Browse files Browse the repository at this point in the history
Merge release 2.17.0 into 3.0.x
  • Loading branch information
boesing authored Oct 1, 2023
2 parents e811226 + 923b3da commit 5447814
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .laminas-ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extensions": [
"igbinary"
]
],
"ignore_php_platform_requirements": {
"8.3": true
}
}
13 changes: 13 additions & 0 deletions .laminas-ci/pre-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

PHP_VERSION=$4

if [ "${PHP_VERSION}" != "8.3" ]; then
exit 0;
fi

set -e -o pipefail

pecl install igbinary

echo "extension = igbinary.so" > /etc/php/${PHP_VERSION}/mods-available/igbinary.ini
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
},
"require": {
"php": "~8.1.0 || ~8.2.0",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"laminas/laminas-json": "^3.1",
"laminas/laminas-servicemanager": "^4.0",
"laminas/laminas-stdlib": "^3.2"
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/Adapter/PhpSerialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use function unserialize;

use const E_NOTICE;
use const E_WARNING;
use const PHP_VERSION_ID;

final class PhpSerialize extends AbstractAdapter
{
Expand Down Expand Up @@ -98,7 +100,12 @@ public function unserialize(string $serialized): mixed
return false;
}

ErrorHandler::start(E_NOTICE);
$errorLevel = E_NOTICE;
if (PHP_VERSION_ID >= 80300) {
$errorLevel = E_WARNING;
}

ErrorHandler::start($errorLevel);
// The second parameter to unserialize() is only available on PHP 7.0 or higher
$ret = unserialize($serialized, ['allowed_classes' => $this->getOptions()->getUnserializeClassWhitelist()]);
$err = ErrorHandler::stop();
Expand Down

0 comments on commit 5447814

Please sign in to comment.