|
|
@@ -2721,34 +2721,6 @@ function bx_api_get_browse_params($sParams, $bParamsOnly = false)
|
|
|
return $aParams['params'];
|
|
|
}
|
|
|
|
|
|
-function bx_is_serialized_safe($str)
|
|
|
-{
|
|
|
- if (!is_string($str))
|
|
|
- return false;
|
|
|
-
|
|
|
- $str = trim($str);
|
|
|
- if ($str === 'N;')
|
|
|
- return true; // null
|
|
|
-
|
|
|
- if (!preg_match('/^([adObis]):[0-9]+:/', $str, $matches))
|
|
|
- return false;
|
|
|
-
|
|
|
- $type = $matches[1];
|
|
|
-
|
|
|
- // allow only base types, exclude objects (O) are references (r, R)
|
|
|
- $allowedTypes = ['a', 's', 'i', 'd', 'b'];
|
|
|
- if (!in_array($type, $allowedTypes))
|
|
|
- return false;
|
|
|
-
|
|
|
- try {
|
|
|
- $unserialized = unserialize($str);
|
|
|
- return true;
|
|
|
- } catch (Exception $e) {
|
|
|
- return false;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
function bx_is_serialized($string)
|
|
|
{
|
|
|
if (!is_string($string))
|