You are here

function safe_unserialize in Webform Multiple File Upload 7

Same name and namespace in other branches
  1. 6 safe_unserialize.inc \safe_unserialize()

Wrapper for _safe_unserialize() that handles exceptions and multibyte encoding issue

Parameters

string $str:

Return value

mixed

1 call to safe_unserialize()
webform_multifile_update_7001 in ./webform_multifile.install
Convert serialized php arrays to json encoded strings.
1 string reference to 'safe_unserialize'
webform_multifile_update_7001 in ./webform_multifile.install
Convert serialized php arrays to json encoded strings.

File

./safe_unserialize.inc, line 138
Contains helper functions for webform_multifile_update_7001().

Code

function safe_unserialize($str) {

  // ensure we use the byte count for strings even when strlen() is overloaded by mb_strlen()
  if (function_exists('mb_internal_encoding') && (int) ini_get('mbstring.func_overload') & 2) {
    $mbIntEnc = mb_internal_encoding();
    mb_internal_encoding('ASCII');
  }
  $out = _safe_unserialize($str);
  if (isset($mbIntEnc)) {
    mb_internal_encoding($mbIntEnc);
  }
  return $out;
}