From 92504acfdd10455dc63cb9f242818bb0cc159ddd Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 21 Dec 2020 10:09:03 -0800 Subject: [PATCH] Backward compatibility with PHP 5.6 --- e107_handlers/core_functions.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/e107_handlers/core_functions.php b/e107_handlers/core_functions.php index 8a7edf2ee..4ac89425c 100644 --- a/e107_handlers/core_functions.php +++ b/e107_handlers/core_functions.php @@ -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 {