diff --git a/e107_handlers/core_functions.php b/e107_handlers/core_functions.php index d97ecfe47..e9193a74b 100644 --- a/e107_handlers/core_functions.php +++ b/e107_handlers/core_functions.php @@ -536,13 +536,13 @@ class e_array { * * @param array $ArrayData array to be stored * @param bool|string $mode true = var_export with addedslashes, false = var_export (default), 'json' = json encoded - * @return string + * @return null|string */ public function serialize($ArrayData, $mode = false) { if (!is_array($ArrayData) || empty($ArrayData)) { - return false; + return null; } if($mode === 'json') diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 1531b9a4a..85c40ca86 100755 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -1763,11 +1763,6 @@ class e107 */ public static function serialize($ArrayData, $mode = false) { - if(empty($ArrayData)) - { - return array(); - } - return self::getArrayStorage()->serialize($ArrayData, $mode); } diff --git a/e107_handlers/xml_class.php b/e107_handlers/xml_class.php index 51d010605..9d052fdcf 100644 --- a/e107_handlers/xml_class.php +++ b/e107_handlers/xml_class.php @@ -863,8 +863,12 @@ class xmlClass if(is_array($val)) { - // $val = ""; $val = e107::serialize($val,false); + + if($val === null) + { + return ''; + } } if($this->convertFilePaths) @@ -873,15 +877,11 @@ class xmlClass $val = preg_replace_callback("#({e_.*?\.(".$types."))#i", array($this,'replaceFilePaths'), $val); } - - if((strpos($val,"<")!==FALSE) || (strpos($val,">")!==FALSE) || (strpos($val,"&")!==FALSE)) { return ""; } - - $val = str_replace(chr(1),'{\u0001}',$val); return $val;