1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-21 21:21:54 +02:00

Backward compatibility with PHP 5.6

This commit is contained in:
Cameron 2020-12-21 10:09:03 -08:00
parent 630f3f415f
commit 92504acfdd

View File

@ -447,8 +447,16 @@ class e_array {
$first2Chars = substr($ArrayData,0,2);
if($first2Chars === 'a:' || $first2Chars === 's:') // php serialize.
{
$dat = unserialize($ArrayData, ['allowed_classes' => false]);
$ArrayData = $this->WriteArray($dat,FALSE);
if(PHP_MAJOR_VERSION > 5)
{
$dat = unserialize($ArrayData, ['allowed_classes' => false]);
}
else
{
$dat = unserialize($ArrayData);
}
$ArrayData = $this->serialize($dat,FALSE);
}
elseif(strpos($ArrayData,'{') === 0 || strpos($ArrayData,'[') === 0) // json
{