Index: includes/actions.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/actions.inc,v
retrieving revision 1.39
diff -u -p -r1.39 actions.inc
--- includes/actions.inc	22 Aug 2010 11:04:09 -0000	1.39
+++ includes/actions.inc	24 Sep 2010 01:19:25 -0000
@@ -88,7 +88,7 @@ function actions_do($action_ids, $object
       $query->condition('aid', $conditions, 'IN');
       $result = $query->execute();
       foreach ($result as $action) {
-        $actions[$action->aid] = $action->parameters ? unserialize($action->parameters) : array();
+        $actions[$action->aid] = $action->parameters ? drupal_unserialize($action->parameters) : array();
         $actions[$action->aid]['callback'] = $action->callback;
         $actions[$action->aid]['type'] = $action->type;
       }
@@ -120,7 +120,7 @@ function actions_do($action_ids, $object
       $action = db_query("SELECT callback, parameters FROM {actions} WHERE aid = :aid", array(':aid' => $action_ids))->fetchObject();
       $function = $action->callback;
       if (function_exists($function)) {
-        $context = array_merge($context, unserialize($action->parameters));
+        $context = array_merge($context, drupal_unserialize($action->parameters));
         $actions_result[$action_ids] = $function($object, $context, $a1, $a2);
       }
       else {
@@ -348,7 +348,7 @@ function actions_save($function, $type, 
     ->fields(array(
       'callback' => $function,
       'type' => $type,
-      'parameters' => serialize($params),
+      'parameters' => drupal_serialize($params),
       'label' => $label,
     ))
     ->execute();
Index: includes/batch.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/batch.inc,v
retrieving revision 1.51
diff -u -p -r1.51 batch.inc
--- includes/batch.inc	13 Sep 2010 01:09:25 -0000	1.51
+++ includes/batch.inc	24 Sep 2010 01:19:29 -0000
@@ -31,7 +31,7 @@ function batch_load($id) {
     ':token' => drupal_get_token($id),
   ))->fetchField();
   if ($batch) {
-    return unserialize($batch);
+    return drupal_unserialize($batch);
   }
   return FALSE;
 }
@@ -514,7 +514,7 @@ function _batch_finished() {
 function _batch_shutdown() {
   if ($batch = batch_get()) {
     db_update('batch')
-      ->fields(array('batch' => serialize($batch)))
+      ->fields(array('batch' => drupal_serialize($batch)))
       ->condition('bid', $batch['id'])
       ->execute();
   }
Index: includes/batch.queue.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/batch.queue.inc,v
retrieving revision 1.1
diff -u -p -r1.1 batch.queue.inc
--- includes/batch.queue.inc	8 Jan 2010 06:36:34 -0000	1.1
+++ includes/batch.queue.inc	24 Sep 2010 01:19:34 -0000
@@ -23,7 +23,7 @@ class BatchQueue extends SystemQueue {
   public function claimItem($lease_time = 0) {
     $item = db_query('SELECT data, item_id FROM {queue} q WHERE name = :name ORDER BY item_id ASC', array(':name' => $this->name))->fetchObject();
     if ($item) {
-      $item->data = unserialize($item->data);
+      $item->data = drupal_unserialize($item->data);
       return $item;
     }
     return FALSE;
@@ -38,7 +38,7 @@ class BatchQueue extends SystemQueue {
     $result = array();
     $items = db_query('SELECT data FROM {queue} q WHERE name = :name ORDER BY item_id ASC', array(':name' => $this->name))->fetchAll();
     foreach ($items as $item) {
-      $result[] = unserialize($item->data);
+      $result[] = drupal_unserialize($item->data);
     }
     return $result;
   }
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.419
diff -u -p -r1.419 bootstrap.inc
--- includes/bootstrap.inc	16 Sep 2010 01:10:38 -0000	1.419
+++ includes/bootstrap.inc	24 Sep 2010 02:18:04 -0000
@@ -324,6 +324,23 @@ function timer_stop($name) {
   return $timers[$name];
 }
 
+function drupal_serialize($var) {
+  return json_encode($var);
+}
+
+function drupal_unserialize($string) {
+  if ($string[0] === '{' || $string[0] === '[') {
+    $result = json_decode($string, TRUE);
+  }
+  elseif ($string[1] === ':') {
+    $result = unserialize($string);
+  }
+  else {
+    $result = $string;
+  }
+  return $result;
+}
+
 /**
  * Find the appropriate configuration directory.
  *
@@ -759,7 +776,7 @@ function variable_initialize($conf = arr
     }
     else {
       // Proceed with variable rebuild.
-      $variables = array_map('unserialize', db_query('SELECT name, value FROM {variable}')->fetchAllKeyed());
+      $variables = array_map('drupal_unserialize', db_query('SELECT name, value FROM {variable}')->fetchAllKeyed());
       cache_set('variables', $variables, 'cache_bootstrap');
       lock_release($name);
     }
@@ -815,7 +832,7 @@ function variable_get($name, $default = 
 function variable_set($name, $value) {
   global $conf;
 
-  db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute();
+  db_merge('variable')->key(array('name' => $name))->fields(array('value' => drupal_serialize($value)))->execute();
 
   cache_clear_all('variables', 'cache_bootstrap');
 
@@ -1217,7 +1234,7 @@ function bootstrap_hooks() {
  *   The attribute of $obj whose value should be unserialized.
  */
 function drupal_unpack($obj, $field = 'data') {
-  if ($obj->$field && $data = unserialize($obj->$field)) {
+  if ($obj->$field && $data = drupal_unserialize($obj->$field)) {
     foreach ($data as $key => $value) {
       if (!empty($key) && !isset($obj->$key)) {
         $obj->$key = $value;
Index: includes/cache.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/cache.inc,v
retrieving revision 1.48
diff -u -p -r1.48 cache.inc
--- includes/cache.inc	18 May 2010 18:26:30 -0000	1.48
+++ includes/cache.inc	24 Sep 2010 01:19:52 -0000
@@ -395,7 +395,7 @@ class DrupalDatabaseCache implements Dru
     }
 
     if ($cache->serialized) {
-      $cache->data = unserialize($cache->data);
+      $cache->data = drupal_unserialize($cache->data);
     }
 
     return $cache;
@@ -408,7 +408,7 @@ class DrupalDatabaseCache implements Dru
       'expire' => $expire,
     );
     if (!is_string($data)) {
-      $fields['data'] = serialize($data);
+      $fields['data'] = drupal_serialize($data);
       $fields['serialized'] = 1;
     }
     else {
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1224
diff -u -p -r1.1224 common.inc
--- includes/common.inc	24 Sep 2010 00:37:41 -0000	1.1224
+++ includes/common.inc	24 Sep 2010 01:55:04 -0000
@@ -3216,7 +3216,7 @@ function drupal_build_css_cache($css) {
   $data = '';
   $uri = '';
   $map = variable_get('drupal_css_cache_files', array());
-  $key = hash('sha256', serialize($css));
+  $key = hash('sha256', drupal_serialize($css));
   if (isset($map[$key])) {
     $uri = $map[$key];
   }
@@ -4427,7 +4427,7 @@ function drupal_build_js_cache($files) {
   $contents = '';
   $uri = '';
   $map = variable_get('drupal_js_cache_files', array());
-  $key = hash('sha256', serialize($files));
+  $key = hash('sha256', drupal_serialize($files));
   if (isset($map[$key])) {
     $uri = $map[$key];
   }
@@ -4517,7 +4517,7 @@ function drupal_get_hash_salt() {
   global $drupal_hash_salt, $databases;
   // If the $drupal_hash_salt variable is empty, a hash of the serialized
   // database credentials is used as a fallback salt.
-  return empty($drupal_hash_salt) ? hash('sha256', serialize($databases)) : $drupal_hash_salt;
+  return empty($drupal_hash_salt) ? hash('sha256', drupal_serialize($databases)) : $drupal_hash_salt;
 }
 
 /**
@@ -5369,7 +5369,7 @@ function drupal_render_cache_set(&$marku
 function drupal_render_cache_by_query($query, $function, $expire = CACHE_TEMPORARY, $granularity = NULL) {
   $cache_keys = array_merge(array($function), drupal_render_cid_parts($granularity));
   $query->preExecute();
-  $cache_keys[] = hash('sha256', serialize(array((string) $query, $query->getArguments())));
+  $cache_keys[] = hash('sha256', drupal_serialize(array((string) $query, $query->getArguments())));
   return array(
     '#query' => $query,
     '#pre_render' => array($function . '_pre_render'),
@@ -6214,7 +6214,7 @@ function drupal_write_record($table, &$r
       $fields[$field] = $object->$field;
     }
     else {
-      $fields[$field] = serialize($object->$field);
+      $fields[$field] = drupal_serialize($object->$field);
     }
 
     // Type cast to proper datatype, except when the value is NULL and the
Index: includes/errors.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/errors.inc,v
retrieving revision 1.8
diff -u -p -r1.8 errors.inc
--- includes/errors.inc	28 Jun 2010 20:27:34 -0000	1.8
+++ includes/errors.inc	24 Sep 2010 01:16:02 -0000
@@ -196,7 +196,7 @@ function _drupal_log_error($error, $fata
         'line' => $error['%line'],
       ),
     );
-    header('X-Drupal-Assertion-' . $number . ': ' . rawurlencode(serialize($assertion)));
+    header('X-Drupal-Assertion-' . $number . ': ' . rawurlencode(drupal_serialize($assertion)));
     $number++;
   }
 
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.494
diff -u -p -r1.494 form.inc
--- includes/form.inc	22 Sep 2010 03:34:57 -0000	1.494
+++ includes/form.inc	24 Sep 2010 01:16:08 -0000
@@ -3804,7 +3804,7 @@ function batch_process($redirect = NULL,
           'bid' => $batch['id'],
           'timestamp' => REQUEST_TIME,
           'token' => drupal_get_token($batch['id']),
-          'batch' => serialize($batch),
+          'batch' => drupal_serialize($batch),
         ))
         ->execute();
 
Index: includes/install.core.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.core.inc,v
retrieving revision 1.33
diff -u -p -r1.33 install.core.inc
--- includes/install.core.inc	23 Sep 2010 23:59:28 -0000	1.33
+++ includes/install.core.inc	24 Sep 2010 01:19:56 -0000
@@ -781,7 +781,7 @@ function install_system_module(&$install
 function install_verify_completed_task() {
   try {
     if ($result = db_query("SELECT value FROM {variable} WHERE name = :name", array('name' => 'install_task'))) {
-      $task = unserialize($result->fetchField());
+      $task = drupal_unserialize($result->fetchField());
     }
   }
   // Do not trigger an error if the database query fails, since the database
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.411
diff -u -p -r1.411 menu.inc
--- includes/menu.inc	24 Sep 2010 00:37:41 -0000	1.411
+++ includes/menu.inc	24 Sep 2010 01:20:09 -0000
@@ -356,7 +356,7 @@ function menu_get_ancestors($parts) {
  *   The $data array unserialized and mapped.
  */
 function menu_unserialize($data, $map) {
-  if ($data = unserialize($data)) {
+  if ($data = drupal_unserialize($data)) {
     foreach ($data as $k => $v) {
       if (is_int($v)) {
         $data[$k] = isset($map[$v]) ? $map[$v] : '';
@@ -517,7 +517,7 @@ function menu_execute_active_handler($pa
 function _menu_load_objects(&$item, &$map) {
   if ($load_functions = $item['load_functions']) {
     // If someone calls this function twice, then unserialize will fail.
-    if ($load_functions_unserialized = unserialize($load_functions)) {
+    if ($load_functions_unserialized = drupal_unserialize($load_functions)) {
       $load_functions = $load_functions_unserialized;
     }
     $path_map = $map;
@@ -770,7 +770,7 @@ function _menu_translate(&$router_item, 
  *   An array of helper function (ex: array(2 => 'menu_tail_to_arg'))
  */
 function _menu_link_map_translate(&$map, $to_arg_functions) {
-  $to_arg_functions = unserialize($to_arg_functions);
+  $to_arg_functions = drupal_unserialize($to_arg_functions);
   foreach ($to_arg_functions as $index => $function) {
     // Translate place-holders into real values.
     $arg = $function(!empty($map[$index]) ? $map[$index] : '', $map, $index);
@@ -809,7 +809,7 @@ function menu_tail_to_arg($arg, $map, $i
  */
 function _menu_link_translate(&$item, $translate = FALSE) {
   if (!is_array($item['options'])) {
-    $item['options'] = unserialize($item['options']);
+    $item['options'] = drupal_unserialize($item['options']);
   }
   if ($item['external']) {
     $item['access'] = 1;
@@ -1270,7 +1270,7 @@ function _menu_build_tree($menu_name, ar
   if (isset($parameters['expanded'])) {
     sort($parameters['expanded']);
   }
-  $tree_cid = 'links:' . $menu_name . ':tree-data:' . $GLOBALS['language']->language . ':' . hash('sha256', serialize($parameters));
+  $tree_cid = 'links:' . $menu_name . ':tree-data:' . $GLOBALS['language']->language . ':' . hash('sha256', drupal_serialize($parameters));
 
   // If we do not have this tree in the static cache, check {cache_menu}.
   if (!isset($trees[$tree_cid])) {
@@ -2782,7 +2782,7 @@ function menu_load_links($menu_name) {
     ->fetchAll();
 
   foreach ($links as &$link) {
-    $link['options'] = unserialize($link['options']);
+    $link['options'] = drupal_unserialize($link['options']);
   }
   return $links;
 }
@@ -2897,7 +2897,7 @@ function menu_link_save(&$item) {
   $existing_item = FALSE;
   if (isset($item['mlid'])) {
     if ($existing_item = db_query("SELECT * FROM {menu_links} WHERE mlid = :mlid", array(':mlid' => $item['mlid']))->fetchAssoc()) {
-      $existing_item['options'] = unserialize($existing_item['options']);
+      $existing_item['options'] = drupal_unserialize($existing_item['options']);
     }
   }
 
@@ -2960,7 +2960,7 @@ function menu_link_save(&$item) {
         'weight' => $item['weight'],
         'module' => $item['module'],
         'link_title' => $item['link_title'],
-        'options' => serialize($item['options']),
+        'options' => drupal_serialize($item['options']),
         'customized' => $item['customized'],
         'updated' => $item['updated'],
       ))
@@ -3034,7 +3034,7 @@ function menu_link_save(&$item) {
         'p9' => $item['p9'],
         'module' => $item['module'],
         'link_title' => $item['link_title'],
-        'options' => serialize($item['options']),
+        'options' => drupal_serialize($item['options']),
         'customized' => $item['customized'],
       ))
       ->condition('mlid', $item['mlid'])
@@ -3159,7 +3159,7 @@ function menu_link_maintain($module, $op
       $result = db_query("SELECT * FROM {menu_links} WHERE link_path = :link_path AND module = :module AND customized = 0", array(':link_path' => $link_path, ':module' => $module))->fetchAll(PDO::FETCH_ASSOC);
       foreach ($result as $link) {
         $link['link_title'] = $link_title;
-        $link['options'] = unserialize($link['options']);
+        $link['options'] = drupal_unserialize($link['options']);
         menu_link_save($link);
       }
       break;
@@ -3353,8 +3353,8 @@ function _menu_router_build($callbacks) 
       $fit = (1 << $number_parts) - 1;
     }
     $masks[$fit] = 1;
-    $item['load_functions'] = empty($load_functions) ? '' : serialize($load_functions);
-    $item['to_arg_functions'] = empty($to_arg_functions) ? '' : serialize($to_arg_functions);
+    $item['load_functions'] = empty($load_functions) ? '' : drupal_serialize($load_functions);
+    $item['to_arg_functions'] = empty($to_arg_functions) ? '' : drupal_serialize($to_arg_functions);
     $item += array(
       'title' => '',
       'weight' => 0,
@@ -3550,9 +3550,9 @@ function _menu_router_save($menu, $masks
       'load_functions' => $item['load_functions'],
       'to_arg_functions' => $item['to_arg_functions'],
       'access_callback' => $item['access callback'],
-      'access_arguments' => serialize($item['access arguments']),
+      'access_arguments' => drupal_serialize($item['access arguments']),
       'page_callback' => $item['page callback'],
-      'page_arguments' => serialize($item['page arguments']),
+      'page_arguments' => drupal_serialize($item['page arguments']),
       'delivery_callback' => $item['delivery callback'],
       'fit' => $item['_fit'],
       'number_parts' => $item['_number_parts'],
@@ -3561,9 +3561,9 @@ function _menu_router_save($menu, $masks
       'tab_root' => $item['tab_root'],
       'title' => $item['title'],
       'title_callback' => $item['title callback'],
-      'title_arguments' => ($item['title arguments'] ? serialize($item['title arguments']) : ''),
+      'title_arguments' => ($item['title arguments'] ? drupal_serialize($item['title arguments']) : ''),
       'theme_callback' => $item['theme callback'],
-      'theme_arguments' => serialize($item['theme arguments']),
+      'theme_arguments' => drupal_serialize($item['theme arguments']),
       'type' => $item['type'],
       'block_callback' => $item['block callback'],
       'description' => $item['description'],
Index: includes/module.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/module.inc,v
retrieving revision 1.198
diff -u -p -r1.198 module.inc
--- includes/module.inc	3 Sep 2010 19:49:55 -0000	1.198
+++ includes/module.inc	24 Sep 2010 02:07:02 -0000
@@ -124,6 +124,7 @@ function system_list($type) {
     // drupal_get_filename() static cache for bootstrap modules only.
     // The rest is stored separately to keep the bootstrap module cache small.
     foreach ($bootstrap_list as $module) {
+      $module = (object) $module;
       drupal_get_filename('module', $module->name, $module->filename);
     }
     // We only return the module names here since module_list() doesn't need
@@ -134,6 +135,15 @@ function system_list($type) {
   elseif (!isset($lists['module_enabled'])) {
     if ($cached = cache_get('system_list', 'cache_bootstrap')) {
       $lists = $cached->data;
+      foreach ($lists as $list_type => $items) {
+        if ($list_type != 'filepaths') {
+          foreach ($lists[$list_type] as $key => $item) {
+            if (is_array($item)) {
+              $lists[$list_type][$key] = (object) $item;
+            }
+          }
+        }
+      }
     }
     else {
       $lists = array(
@@ -148,7 +158,7 @@ function system_list($type) {
       // consistent with the one used in module_implements().
       $result = db_query("SELECT * FROM {system} WHERE type = 'theme' OR (type = 'module' AND status = 1) ORDER BY weight ASC, name ASC");
       foreach ($result as $record) {
-        $record->info = unserialize($record->info);
+        $record->info = drupal_unserialize($record->info);
         // Build a list of all enabled modules.
         if ($record->type == 'module') {
           $lists['module_enabled'][$record->name] = $record;
Index: includes/registry.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/registry.inc,v
retrieving revision 1.34
diff -u -p -r1.34 registry.inc
--- includes/registry.inc	17 Sep 2010 14:45:46 -0000	1.34
+++ includes/registry.inc	24 Sep 2010 01:20:18 -0000
@@ -39,7 +39,7 @@ function _registry_update() {
   // Get the list of files we are going to parse.
   $files = array();
   foreach ($modules as &$module) {
-    $module->info = unserialize($module->info);
+    $module->info = drupal_unserialize($module->info);
     $dir = dirname($module->filename);
 
     // Store the module directory for use in hook_registry_files_alter().
Index: includes/session.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/session.inc,v
retrieving revision 1.89
diff -u -p -r1.89 session.inc
--- includes/session.inc	17 Sep 2010 14:56:27 -0000	1.89
+++ includes/session.inc	24 Sep 2010 01:20:22 -0000
@@ -105,7 +105,7 @@ function _drupal_session_read($sid) {
   // active user.
   if ($user && $user->uid > 0 && $user->status == 1) {
     // This is done to unserialize the data member of $user.
-    $user->data = unserialize($user->data);
+    $user->data = drupal_unserialize($user->data);
 
     // Add roles element to $user.
     $user->roles = array();
Index: includes/update.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/update.inc,v
retrieving revision 1.68
diff -u -p -r1.68 update.inc
--- includes/update.inc	17 Sep 2010 02:28:37 -0000	1.68
+++ includes/update.inc	24 Sep 2010 01:20:26 -0000
@@ -299,7 +299,7 @@ function update_fix_d7_block_deltas(&$sa
     ->range(0, $limit)
     ->execute();
   foreach ($result as $row) {
-    $data = unserialize($row->data);
+    $data = drupal_unserialize($row->data);
     $user_needs_update = FALSE;
     foreach ($renamed_deltas as $module => $deltas) {
       foreach ($deltas as $old_delta => $new_delta) {
@@ -326,7 +326,7 @@ function update_fix_d7_block_deltas(&$sa
     // Update the current user.
     if ($user_needs_update) {
       db_update('users')
-        ->fields(array('data' => serialize($data)))
+        ->fields(array('data' => drupal_serialize($data)))
         ->condition('uid', $row->uid)
         ->execute();
     }
@@ -686,7 +686,7 @@ function update_fix_d7_install_profile()
     $values = array(
       'filename' => $filename,
       'name' => $profile,
-      'info' => serialize($info),
+      'info' => drupal_serialize($info),
       'schema_version' => 0,
       'type' => 'module',
       'status' => 1,
Index: modules/book/book.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.admin.inc,v
retrieving revision 1.36
diff -u -p -r1.36 book.admin.inc
--- modules/book/book.admin.inc	26 Jun 2010 21:32:20 -0000	1.36
+++ modules/book/book.admin.inc	24 Sep 2010 01:17:21 -0000
@@ -154,7 +154,7 @@ function _book_admin_table($node, &$form
   $tree = book_menu_subtree_data($node->book);
   $tree = array_shift($tree); // Do not include the book item itself.
   if ($tree['below']) {
-    $hash = drupal_hash_base64(serialize($tree['below']));
+    $hash = drupal_hash_base64(drupal_serialize($tree['below']));
     // Store the hash value as a hidden form element so that we can detect
     // if another user changed the book hierarchy.
     $form['tree_hash'] = array(
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.553
diff -u -p -r1.553 book.module
--- modules/book/book.module	24 Sep 2010 00:37:42 -0000	1.553
+++ modules/book/book.module	24 Sep 2010 01:20:31 -0000
@@ -365,7 +365,7 @@ function book_get_books() {
       $result2 = $query->execute();
       foreach ($result2 as $link) {
         $link['href'] = $link['link_path'];
-        $link['options'] = unserialize($link['options']);
+        $link['options'] = drupal_unserialize($link['options']);
         $all_books[$link['bid']] = $link;
       }
     }
@@ -781,7 +781,7 @@ function book_node_load($nodes, $types) 
     $nodes[$record['nid']]->book = $record;
     $nodes[$record['nid']]->book['href'] = $record['link_path'];
     $nodes[$record['nid']]->book['title'] = $record['link_title'];
-    $nodes[$record['nid']]->book['options'] = unserialize($record['options']);
+    $nodes[$record['nid']]->book['options'] = drupal_unserialize($record['options']);
   }
 }
 
@@ -1282,7 +1282,7 @@ function book_menu_subtree_data($link) {
       $data['node_links'] = array();
       menu_tree_collect_node_links($data['tree'], $data['node_links']);
       // Compute the real cid for book subtree data.
-      $tree_cid = 'links:' . $item['menu_name'] . ':subtree-data:' . hash('sha256', serialize($data));
+      $tree_cid = 'links:' . $item['menu_name'] . ':subtree-data:' . hash('sha256', drupal_serialize($data));
       // Cache the data, if it is not already in the cache.
 
       if (!cache_get($tree_cid, 'cache_menu')) {
Index: modules/color/color.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/color/color.module,v
retrieving revision 1.91
diff -u -p -r1.91 color.module
--- modules/color/color.module	22 Sep 2010 03:24:09 -0000	1.91
+++ modules/color/color.module	24 Sep 2010 01:17:30 -0000
@@ -329,7 +329,7 @@ function color_scheme_form_submit($form,
   }
 
   // Prepare target locations for generated files.
-  $id = $theme . '-' . substr(hash('sha256', serialize($palette) . microtime()), 0, 8);
+  $id = $theme . '-' . substr(hash('sha256', drupal_serialize($palette) . microtime()), 0, 8);
   $paths['color'] = 'public://color';
   $paths['target'] = $paths['color'] . '/' . $id;
   foreach ($paths as $path) {
Index: modules/dblog/dblog.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.admin.inc,v
retrieving revision 1.40
diff -u -p -r1.40 dblog.admin.inc
--- modules/dblog/dblog.admin.inc	9 Sep 2010 15:47:03 -0000	1.40
+++ modules/dblog/dblog.admin.inc	24 Sep 2010 01:20:36 -0000
@@ -261,7 +261,7 @@ function theme_dblog_message($variables)
     }
     // Message to translate with injected variables.
     else {
-      $output = t($event->message, unserialize($event->variables));
+      $output = t($event->message, drupal_unserialize($event->variables));
     }
     if ($variables['link'] && isset($event->wid)) {
       // Truncate message to 56 chars.
Index: modules/dblog/dblog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.module,v
retrieving revision 1.56
diff -u -p -r1.56 dblog.module
--- modules/dblog/dblog.module	24 Sep 2010 00:37:42 -0000	1.56
+++ modules/dblog/dblog.module	24 Sep 2010 01:17:33 -0000
@@ -131,7 +131,7 @@ function dblog_watchdog(array $log_entry
       'uid' => $log_entry['user']->uid,
       'type' => substr($log_entry['type'], 0, 64),
       'message' => $log_entry['message'],
-      'variables' => serialize($log_entry['variables']),
+      'variables' => drupal_serialize($log_entry['variables']),
       'severity' => $log_entry['severity'],
       'link' => substr($log_entry['link'], 0, 255),
       'location' => $log_entry['request_uri'],
Index: modules/dblog/dblog.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.test,v
retrieving revision 1.39
diff -u -p -r1.39 dblog.test
--- modules/dblog/dblog.test	1 Sep 2010 03:03:05 -0000	1.39
+++ modules/dblog/dblog.test	24 Sep 2010 01:20:40 -0000
@@ -57,7 +57,7 @@ class DBLogTestCase extends DrupalWebTes
     $current_limit = variable_get('dblog_row_limit', 1000);
     $this->assertTrue($current_limit == $row_limit, t('[Cache] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit)));
     // Verify dblog row limit equals specified row limit.
-    $current_limit = unserialize(db_query("SELECT value FROM {variable} WHERE name = :dblog_limit", array(':dblog_limit' => 'dblog_row_limit'))->fetchField());
+    $current_limit = drupal_unserialize(db_query("SELECT value FROM {variable} WHERE name = :dblog_limit", array(':dblog_limit' => 'dblog_row_limit'))->fetchField());
     $this->assertTrue($current_limit == $row_limit, t('[Variable table] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit)));
   }
 
Index: modules/field/field.crud.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.crud.inc,v
retrieving revision 1.69
diff -u -p -r1.69 field.crud.inc
--- modules/field/field.crud.inc	11 Sep 2010 00:03:42 -0000	1.69
+++ modules/field/field.crud.inc	24 Sep 2010 01:20:45 -0000
@@ -537,7 +537,7 @@ function field_read_fields($params = arr
   $fields = array();
   $results = $query->execute();
   foreach ($results as $record) {
-    $field = unserialize($record['data']);
+    $field = drupal_unserialize($record['data']);
     $field['id'] = $record['id'];
     $field['field_name'] = $record['field_name'];
     $field['type'] = $record['type'];
@@ -893,7 +893,7 @@ function field_read_instances($params = 
     // module exposing them was disabled).
     $entity_info = entity_get_info($record['entity_type']);
     if ($include_inactive || $entity_info) {
-      $instance = unserialize($record['data']);
+      $instance = drupal_unserialize($record['data']);
       $instance['id'] = $record['id'];
       $instance['field_id'] = $record['field_id'];
       $instance['field_name'] = $record['field_name'];
Index: modules/field/field.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.install,v
retrieving revision 1.20
diff -u -p -r1.20 field.install
--- modules/field/field.install	13 Sep 2010 05:50:09 -0000	1.20
+++ modules/field/field.install	24 Sep 2010 01:17:38 -0000
@@ -215,7 +215,7 @@ function _update_7000_field_create_field
     'storage_module' => $field['storage']['module'],
     'storage_active' => (int) $field['storage']['active'],
     'locked' => (int) $field['locked'],
-    'data' => serialize($data),
+    'data' => drupal_serialize($data),
     'cardinality' => $field['cardinality'],
     'translatable' => (int) $field['translatable'],
     'deleted' => (int) $field['deleted'],
@@ -265,7 +265,7 @@ function _update_7000_field_create_insta
     'field_name' => $instance['field_name'],
     'entity_type' => $instance['entity_type'],
     'bundle' => $instance['bundle'],
-    'data' => serialize($data),
+    'data' => drupal_serialize($data),
     'deleted' => (int) $instance['deleted'],
   );
   $instance['id'] = db_insert('field_config_instance')
Index: modules/field/tests/field.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/tests/field.test,v
retrieving revision 1.41
diff -u -p -r1.41 field.test
--- modules/field/tests/field.test	24 Sep 2010 00:37:42 -0000	1.41
+++ modules/field/tests/field.test	24 Sep 2010 01:20:52 -0000
@@ -1082,10 +1082,10 @@ class FieldInfoTestCase extends FieldTes
     // third-party module adding a new field setting has been enabled, and
     // existing fields do not know the setting yet).
     $data = db_query('SELECT data FROM {field_config} WHERE field_name = :field_name', array(':field_name' => $field_definition['field_name']))->fetchField();
-    $data = unserialize($data);
+    $data = drupal_unserialize($data);
     $data['settings'] = array();
     db_update('field_config')
-      ->fields(array('data' => serialize($data)))
+      ->fields(array('data' => drupal_serialize($data)))
       ->condition('field_name', $field_definition['field_name'])
       ->execute();
 
@@ -1119,14 +1119,14 @@ class FieldInfoTestCase extends FieldTes
     // third-party module adding instance, widget or display settings has been
     // enabled, but existing instances do not know the new settings).
     $data = db_query('SELECT data FROM {field_config_instance} WHERE field_name = :field_name AND bundle = :bundle', array(':field_name' => $instance_definition['field_name'], ':bundle' => $instance_definition['bundle']))->fetchField();
-    $data = unserialize($data);
+    $data = drupal_unserialize($data);
     $data['settings'] = array();
     $data['widget']['settings'] = 'unavailable_widget';
     $data['widget']['settings'] = array();
     $data['display']['default']['type'] = 'unavailable_formatter';
     $data['display']['default']['settings'] = array();
     db_update('field_config_instance')
-      ->fields(array('data' => serialize($data)))
+      ->fields(array('data' => drupal_serialize($data)))
       ->condition('field_name', $instance_definition['field_name'])
       ->condition('bundle', $instance_definition['bundle'])
       ->execute();
@@ -1779,7 +1779,7 @@ class FieldCrudTestCase extends FieldTes
     // Read the raw record from the {field_config_instance} table.
     $result = db_query('SELECT * FROM {field_config} WHERE field_name = :field_name', array(':field_name' => $field_definition['field_name']));
     $record = $result->fetchAssoc();
-    $record['data'] = unserialize($record['data']);
+    $record['data'] = drupal_unserialize($record['data']);
 
     // Ensure that basic properties are preserved.
     $this->assertEqual($record['field_name'], $field_definition['field_name'], t('The field name is properly saved.'));
@@ -2246,7 +2246,7 @@ class FieldInstanceCrudTestCase extends 
     // Read the raw record from the {field_config_instance} table.
     $result = db_query('SELECT * FROM {field_config_instance} WHERE field_name = :field_name AND bundle = :bundle', array(':field_name' => $this->instance_definition['field_name'], ':bundle' => $this->instance_definition['bundle']));
     $record = $result->fetchAssoc();
-    $record['data'] = unserialize($record['data']);
+    $record['data'] = drupal_unserialize($record['data']);
 
     $field_type = field_info_field_types($this->field['type']);
     $widget_type = field_info_widget_types($field_type['default_widget']);
@@ -2526,7 +2526,7 @@ class FieldTranslationsTestCase extends 
 
     $results = _field_invoke('test_op', $entity_type, $entity);
     foreach ($results as $langcode => $result) {
-      $hash = hash('sha256', serialize(array($entity_type, $entity, $this->field_name, $langcode, $values[$langcode])));
+      $hash = hash('sha256', drupal_serialize(array($entity_type, $entity, $this->field_name, $langcode, $values[$langcode])));
       // Check whether the parameters passed to _field_invoke() were correctly
       // forwarded to the callback function.
       $this->assertEqual($hash, $result, t('The result for %language is correctly stored.', array('%language' => $langcode)));
@@ -2568,7 +2568,7 @@ class FieldTranslationsTestCase extends 
     $grouped_results = _field_invoke_multiple('test_op_multiple', $entity_type, $entities);
     foreach ($grouped_results as $id => $results) {
       foreach ($results as $langcode => $result) {
-        $hash = hash('sha256', serialize(array($entity_type, $entities[$id], $this->field_name, $langcode, $values[$id][$langcode])));
+        $hash = hash('sha256', drupal_serialize(array($entity_type, $entities[$id], $this->field_name, $langcode, $values[$id][$langcode])));
         // Check whether the parameters passed to _field_invoke() were correctly
         // forwarded to the callback function.
         $this->assertEqual($hash, $result, t('The result for entity %id/%language is correctly stored.', array('%id' => $id, '%language' => $langcode)));
Index: modules/field/tests/field_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/tests/field_test.module,v
retrieving revision 1.11
diff -u -p -r1.11 field_test.module
--- modules/field/tests/field_test.module	24 Sep 2010 00:37:42 -0000	1.11
+++ modules/field/tests/field_test.module	24 Sep 2010 01:17:50 -0000
@@ -69,7 +69,7 @@ function field_test_menu() {
  * This simulates a field operation callback to be invoked by _field_invoke().
  */
 function field_test_field_test_op($entity_type, $entity, $field, $instance, $langcode, &$items) {
-  return array($langcode => hash('sha256', serialize(array($entity_type, $entity, $field['field_name'], $langcode, $items))));
+  return array($langcode => hash('sha256', drupal_serialize(array($entity_type, $entity, $field['field_name'], $langcode, $items))));
 }
 
 /**
@@ -81,7 +81,7 @@ function field_test_field_test_op($entit
 function field_test_field_test_op_multiple($entity_type, $entities, $field, $instances, $langcode, &$items) {
   $result = array();
   foreach ($entities as $id => $entity) {
-    $result[$id] = array($langcode => hash('sha256', serialize(array($entity_type, $entity, $field['field_name'], $langcode, $items[$id]))));
+    $result[$id] = array($langcode => hash('sha256', drupal_serialize(array($entity_type, $entity, $field['field_name'], $langcode, $items[$id]))));
   }
   return $result;
 }
Index: modules/filter/filter.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.install,v
retrieving revision 1.45
diff -u -p -r1.45 filter.install
--- modules/filter/filter.install	18 Sep 2010 02:18:35 -0000	1.45
+++ modules/filter/filter.install	24 Sep 2010 01:17:56 -0000
@@ -326,7 +326,7 @@ function filter_update_7003() {
             'module' => $module,
             'name' => $new_name,
             'weight' => $record->weight,
-            'settings' => serialize($settings),
+            'settings' => drupal_serialize($settings),
             'status' => 1,
           ))
           ->execute();
@@ -404,7 +404,7 @@ function filter_update_7005() {
       'weight' => 0,
       'status' => 1,
       'module' => 'filter',
-      'settings' => serialize(array()),
+      'settings' => drupal_serialize(array()),
     ))
     ->values(array(
       'format' => $format_id,
@@ -412,7 +412,7 @@ function filter_update_7005() {
       'weight' => 1,
       'status' => 1,
       'module' => 'filter',
-      'settings' => serialize(array()),
+      'settings' => drupal_serialize(array()),
     ))
     ->values(array(
       'format' => $format_id,
@@ -420,7 +420,7 @@ function filter_update_7005() {
       'weight' => 2,
       'status' => 1,
       'module' => 'filter',
-      'settings' => serialize(array()),
+      'settings' => drupal_serialize(array()),
     ))
     ->execute();
 
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.345
diff -u -p -r1.345 filter.module
--- modules/filter/filter.module	24 Sep 2010 00:37:42 -0000	1.345
+++ modules/filter/filter.module	24 Sep 2010 01:20:57 -0000
@@ -223,7 +223,7 @@ function filter_format_save(&$format) {
     $fields['weight'] = $format->filters[$name]['weight'];
     $fields['status'] = $format->filters[$name]['status'];
     $fields['module'] = $format->filters[$name]['module'];
-    $fields['settings'] = serialize($format->filters[$name]['settings']);
+    $fields['settings'] = drupal_serialize($format->filters[$name]['settings']);
 
     db_merge('filter')
       ->key(array(
@@ -637,7 +637,7 @@ function filter_list_format($format_id) 
       if (isset($filter_info[$name])) {
         $filter->title = $filter_info[$name]['title'];
         // Unpack stored filter settings.
-        $filter->settings = (isset($filter->settings) ? unserialize($filter->settings) : array());
+        $filter->settings = (isset($filter->settings) ? drupal_unserialize($filter->settings) : array());
         // Merge in default settings.
         if (isset($filter_info[$name]['default settings'])) {
           $filter->settings += $filter_info[$name]['default settings'];
Index: modules/filter/filter.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.test,v
retrieving revision 1.76
diff -u -p -r1.76 filter.test
--- modules/filter/filter.test	18 Sep 2010 02:18:35 -0000	1.76
+++ modules/filter/filter.test	24 Sep 2010 01:21:01 -0000
@@ -118,7 +118,7 @@ class FilterCRUDTestCase extends DrupalW
       $this->assertEqual($filter->status, $format_filters[$name]['status'], t('Database: Proper status for %filter in text format %format.', $t_args));
 
       // Verify that filter settings were properly stored.
-      $this->assertEqual(unserialize($filter->settings), isset($format_filters[$name]['settings']) ? $format_filters[$name]['settings'] : array(), t('Database: Proper filter settings for %filter in text format %format.', $t_args));
+      $this->assertEqual(drupal_unserialize($filter->settings), isset($format_filters[$name]['settings']) ? $format_filters[$name]['settings'] : array(), t('Database: Proper filter settings for %filter in text format %format.', $t_args));
 
       // Verify that each filter has a module name assigned.
       $this->assertTrue(!empty($filter->module), t('Database: Proper module name for %filter in text format %format.', $t_args));
Index: modules/help/help.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/help/help.test,v
retrieving revision 1.21
diff -u -p -r1.21 help.test
--- modules/help/help.test	5 Aug 2010 23:53:38 -0000	1.21
+++ modules/help/help.test	24 Sep 2010 01:21:06 -0000
@@ -82,7 +82,7 @@ class HelpTestCase extends DrupalWebTest
     $result = db_query("SELECT name, filename, info FROM {system} WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC");
     foreach ($result as $module) {
       if (file_exists($module->filename) && function_exists($module->name . '_help')) {
-        $fullname = unserialize($module->info);
+        $fullname = drupal_unserialize($module->info);
         $this->modules[$module->name] = $fullname['name'];
       }
     }
Index: modules/image/image.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.module,v
retrieving revision 1.52
diff -u -p -r1.52 image.module
--- modules/image/image.module	24 Sep 2010 00:37:43 -0000	1.52
+++ modules/image/image.module	24 Sep 2010 01:21:10 -0000
@@ -975,7 +975,7 @@ function image_effects() {
       ->orderBy('image_effects.weight', 'ASC')
       ->execute();
     foreach ($result as $effect) {
-      $effect['data'] = unserialize($effect['data']);
+      $effect['data'] = drupal_unserialize($effect['data']);
       $definition = image_effect_definition_load($effect['name']);
       // Do not load image effects whose definition cannot be found.
       if ($definition) {
Index: modules/menu/menu.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.test,v
retrieving revision 1.41
diff -u -p -r1.41 menu.test
--- modules/menu/menu.test	24 Sep 2010 00:37:43 -0000	1.41
+++ modules/menu/menu.test	24 Sep 2010 01:21:13 -0000
@@ -494,7 +494,7 @@ class MenuTestCase extends DrupalWebTest
   function assertMenuLink($mlid, array $expected_item) {
     // Retrieve menu link.
     $item = db_query('SELECT * FROM {menu_links} WHERE mlid = :mlid', array(':mlid' => $mlid))->fetchAssoc();
-    $options = unserialize($item['options']);
+    $options = drupal_unserialize($item['options']);
     if (!empty($options['query'])) {
       $item['link_path'] .= '?' . drupal_http_build_query($options['query']);
     }
Index: modules/profile/profile.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v
retrieving revision 1.293
diff -u -p -r1.293 profile.module
--- modules/profile/profile.module	24 Sep 2010 00:37:44 -0000	1.293
+++ modules/profile/profile.module	24 Sep 2010 01:21:18 -0000
@@ -252,7 +252,7 @@ function profile_user_load($users) {
   $result = db_query('SELECT f.name, f.type, v.uid, v.value FROM {profile_field} f INNER JOIN {profile_value} v ON f.fid = v.fid WHERE uid IN (:uids)', array(':uids' => array_keys($users)));
   foreach ($result as $record) {
     if (empty($users[$record->uid]->{$record->name})) {
-      $users[$record->uid]->{$record->name} = _profile_field_serialize($record->type) ? unserialize($record->value) : $record->value;
+      $users[$record->uid]->{$record->name} = _profile_field_serialize($record->type) ? drupal_unserialize($record->value) : $record->value;
     }
   }
 }
@@ -261,7 +261,7 @@ function profile_save_profile(&$edit, $a
   $result = _profile_get_fields($category, $register);
   foreach ($result as $field) {
     if (_profile_field_serialize($field->type)) {
-      $edit[$field->name] = serialize($edit[$field->name]);
+      $edit[$field->name] = drupal_serialize($edit[$field->name]);
     }
     db_merge('profile_value')
       ->key(array(
Index: modules/rdf/rdf.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/rdf/rdf.module,v
retrieving revision 1.45
diff -u -p -r1.45 rdf.module
--- modules/rdf/rdf.module	9 Sep 2010 20:22:00 -0000	1.45
+++ modules/rdf/rdf.module	24 Sep 2010 01:21:21 -0000
@@ -197,7 +197,7 @@ function _rdf_mapping_load($type, $bundl
   if (!$mapping) {
     return array();
   }
-  return unserialize($mapping);
+  return drupal_unserialize($mapping);
 }
 
 /**
@@ -231,7 +231,7 @@ function rdf_mapping_save(&$mapping) {
       'bundle' => $mapping['bundle'],
     ))
     ->fields(array(
-      'mapping' => serialize($mapping['mapping']),
+      'mapping' => drupal_serialize($mapping['mapping']),
     ))
     ->execute();
 
Index: modules/rdf/rdf.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/rdf/rdf.test,v
retrieving revision 1.27
diff -u -p -r1.27 rdf.test
--- modules/rdf/rdf.test	9 Sep 2010 20:22:00 -0000	1.27
+++ modules/rdf/rdf.test	24 Sep 2010 01:21:26 -0000
@@ -231,7 +231,7 @@ class RdfCrudTestCase extends DrupalWebT
     // Read the raw record from the {rdf_mapping} table.
     $result = db_query('SELECT * FROM {rdf_mapping} WHERE type = :type AND bundle = :bundle', array(':type' => $mapping['type'], ':bundle' => $mapping['bundle']));
     $stored_mapping = $result->fetchAssoc();
-    $stored_mapping['mapping'] = unserialize($stored_mapping['mapping']);
+    $stored_mapping['mapping'] = drupal_unserialize($stored_mapping['mapping']);
     $this->assertEqual($mapping, $stored_mapping, t('Mapping was stored properly in the {rdf_mapping} table.'));
 
     // Verify loading of saved mapping.
@@ -246,7 +246,7 @@ class RdfCrudTestCase extends DrupalWebT
     // Read the raw record from the {rdf_mapping} table.
     $result = db_query('SELECT * FROM {rdf_mapping} WHERE type = :type AND bundle = :bundle', array(':type' => $mapping['type'], ':bundle' => $mapping['bundle']));
     $stored_mapping = $result->fetchAssoc();
-    $stored_mapping['mapping'] = unserialize($stored_mapping['mapping']);
+    $stored_mapping['mapping'] = drupal_unserialize($stored_mapping['mapping']);
     $this->assertEqual($mapping, $stored_mapping, t('Updated mapping was stored properly in the {rdf_mapping} table.'));
 
     // Verify loading of saved mapping.
Index: modules/search/search.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.admin.inc,v
retrieving revision 1.16
diff -u -p -r1.16 search.admin.inc
--- modules/search/search.admin.inc	5 Aug 2010 07:11:15 -0000	1.16
+++ modules/search/search.admin.inc	24 Sep 2010 01:21:30 -0000
@@ -41,7 +41,7 @@ function _search_get_module_names() {
     ->execute();
   $names = array();
   foreach ($modules as $item) {
-    $info = unserialize($item->info);
+    $info = drupal_unserialize($item->info);
     $names[$item->name] = $info['name'];
   }
   return $names;
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.236
diff -u -p -r1.236 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	24 Sep 2010 00:37:44 -0000	1.236
+++ modules/simpletest/drupal_web_test_case.php	24 Sep 2010 01:21:36 -0000
@@ -1540,7 +1540,7 @@ class DrupalWebTestCase extends DrupalTe
     // by DrupalWebTestCase::error().
     if (preg_match('/^X-Drupal-Assertion-[0-9]+: (.*)$/', $header, $matches)) {
       // Call DrupalWebTestCase::error() with the parameters from the header.
-      call_user_func_array(array(&$this, 'error'), unserialize(urldecode($matches[1])));
+      call_user_func_array(array(&$this, 'error'), drupal_unserialize(urldecode($matches[1])));
     }
 
     // Save cookies.
Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.127
diff -u -p -r1.127 common.test
--- modules/simpletest/tests/common.test	19 Sep 2010 18:10:41 -0000	1.127
+++ modules/simpletest/tests/common.test	24 Sep 2010 01:21:41 -0000
@@ -1811,14 +1811,14 @@ class DrupalDataApiTest extends DrupalWe
     $person->info = array();
     $update_result = drupal_write_record('test_serialized', $person, array('id'));
     $result = db_query("SELECT * FROM {test_serialized} WHERE id = :id", array(':id' => $person->id))->fetchObject();
-    $this->assertIdentical(unserialize($result->info), array(), t('Info field updated.'));
+    $this->assertIdentical(drupal_unserialize($result->info), array(), t('Info field updated.'));
 
     // Update the serialized record.
     $data = array('foo' => 'bar', 1 => 2, 'empty' => '', 'null' => NULL);
     $person->info = $data;
     $update_result = drupal_write_record('test_serialized', $person, array('id'));
     $result = db_query("SELECT * FROM {test_serialized} WHERE id = :id", array(':id' => $person->id))->fetchObject();
-    $this->assertIdentical(unserialize($result->info), $data, t('Info field updated.'));
+    $this->assertIdentical(drupal_unserialize($result->info), $data, t('Info field updated.'));
 
     // Run an update query where no field values are changed. The database
     // layer should return zero for number of affected rows, but
Index: modules/simpletest/tests/database_test.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/database_test.test,v
retrieving revision 1.102
diff -u -p -r1.102 database_test.test
--- modules/simpletest/tests/database_test.test	19 Sep 2010 18:45:51 -0000	1.102
+++ modules/simpletest/tests/database_test.test	24 Sep 2010 01:18:15 -0000
@@ -614,7 +614,7 @@ class DatabaseInsertLOBTestCase extends 
       ->fields(array('blob1' => $data))
       ->execute();
     $r = db_query('SELECT * FROM {test_one_blob} WHERE id = :id', array(':id' => $id))->fetchAssoc();
-    $this->assertTrue($r['blob1'] === $data, t('Can insert a blob: id @id, @data.', array('@id' => $id, '@data' => serialize($r))));
+    $this->assertTrue($r['blob1'] === $data, t('Can insert a blob: id @id, @data.', array('@id' => $id, '@data' => drupal_serialize($r))));
   }
 
   /**
@@ -935,7 +935,7 @@ class DatabaseUpdateLOBTestCase extends 
       ->execute();
 
     $r = db_query('SELECT * FROM {test_one_blob} WHERE id = :id', array(':id' => $id))->fetchAssoc();
-    $this->assertTrue($r['blob1'] === $data, t('Can update a blob: id @id, @data.', array('@id' => $id, '@data' => serialize($r))));
+    $this->assertTrue($r['blob1'] === $data, t('Can update a blob: id @id, @data.', array('@id' => $id, '@data' => drupal_serialize($r))));
   }
 
   /**
Index: modules/simpletest/tests/upgrade/upgrade.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/upgrade/upgrade.test,v
retrieving revision 1.7
diff -u -p -r1.7 upgrade.test
--- modules/simpletest/tests/upgrade/upgrade.test	13 Sep 2010 05:50:09 -0000	1.7
+++ modules/simpletest/tests/upgrade/upgrade.test	24 Sep 2010 01:18:19 -0000
@@ -191,7 +191,7 @@ abstract class UpgradePathTestCase exten
     db_insert('variable')
       ->fields(array(
         'name' => $name,
-        'value' => serialize($value),
+        'value' => drupal_serialize($value),
       ))
       ->execute();
 
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.307
diff -u -p -r1.307 system.admin.inc
--- modules/system/system.admin.inc	23 Sep 2010 17:53:09 -0000	1.307
+++ modules/system/system.admin.inc	24 Sep 2010 01:21:46 -0000
@@ -1300,7 +1300,7 @@ function system_modules_uninstall($form,
   $disabled_modules = db_query("SELECT name, filename, info FROM {system} WHERE type = 'module' AND status = 0 AND schema_version > :schema ORDER BY name", array(':schema' => SCHEMA_UNINSTALLED));
   foreach ($disabled_modules as $module) {
     // Grab the module info
-    $info = unserialize($module->info);
+    $info = drupal_unserialize($module->info);
 
     // Load the .install file, and check for an uninstall or schema hook.
     // If the hook exists, the module can be uninstalled.
@@ -3071,7 +3071,7 @@ function system_actions_configure($form,
     $edit['actions_type'] = $data->type;
     $function = $data->callback;
     $action = drupal_hash_base64($data->callback);
-    $params = unserialize($data->parameters);
+    $params = drupal_unserialize($data->parameters);
     if ($params) {
       foreach ($params as $name => $val) {
         $edit[$name] = $val;
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.963
diff -u -p -r1.963 system.module
--- modules/system/system.module	24 Sep 2010 00:37:44 -0000	1.963
+++ modules/system/system.module	24 Sep 2010 01:18:24 -0000
@@ -2166,7 +2166,7 @@ function system_update_files_database(&$
       $updated_fields = array();
 
       // Handle info specially, compare the serialized value.
-      $serialized_info = serialize($files[$file->name]->info);
+      $serialized_info = drupal_serialize($files[$file->name]->info);
       if ($serialized_info != $file->info) {
         $updated_fields['info'] = $serialized_info;
       }
@@ -2215,7 +2215,7 @@ function system_update_files_database(&$
         'name' => $file->name,
         'type' => $type,
         'owner' => isset($file->owner) ? $file->owner : '',
-        'info' => serialize($file->info),
+        'info' => drupal_serialize($file->info),
       ));
       $file->type = $type;
       $file->status = 0;
Index: modules/system/system.queue.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.queue.inc,v
retrieving revision 1.13
diff -u -p -r1.13 system.queue.inc
--- modules/system/system.queue.inc	14 Jun 2010 13:10:31 -0000	1.13
+++ modules/system/system.queue.inc	24 Sep 2010 01:21:51 -0000
@@ -219,7 +219,7 @@ class SystemQueue implements DrupalRelia
     $query = db_insert('queue')
       ->fields(array(
         'name' => $this->name,
-        'data' => serialize($data),
+        'data' => drupal_serialize($data),
         // We cannot rely on REQUEST_TIME because many items might be created
         // by a single request which takes longer than 1 second.
         'created' => time(),
@@ -253,7 +253,7 @@ class SystemQueue implements DrupalRelia
           ->condition('expire', 0);
         // If there are affected rows, this update succeeded.
         if ($update->execute()) {
-          $item->data = unserialize($item->data);
+          $item->data = drupal_unserialize($item->data);
           return $item;
         }
       }
Index: modules/system/system.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.test,v
retrieving revision 1.143
diff -u -p -r1.143 system.test
--- modules/system/system.test	24 Sep 2010 00:37:44 -0000	1.143
+++ modules/system/system.test	24 Sep 2010 01:18:34 -0000
@@ -78,7 +78,7 @@ class ModuleTestCase extends DrupalWebTe
     $count = db_select('watchdog', 'w')
       ->condition('type', $type)
       ->condition('message', $message)
-      ->condition('variables', serialize($variables))
+      ->condition('variables', drupal_serialize($variables))
       ->condition('severity', $severity)
       ->condition('link', $link)
       ->countQuery()
Index: modules/trigger/trigger.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v
retrieving revision 1.65
diff -u -p -r1.65 trigger.module
--- modules/trigger/trigger.module	24 Sep 2010 00:37:44 -0000	1.65
+++ modules/trigger/trigger.module	24 Sep 2010 01:21:55 -0000
@@ -62,7 +62,7 @@ function trigger_menu() {
       ->execute()
       ->fetchField();
     if ($info) {
-      $info = unserialize($info);
+      $info = drupal_unserialize($info);
       $nice_name = $info['name'];
       $items["admin/structure/trigger/$module"] = array(
         'title' => $nice_name,
Index: modules/update/update.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/update/update.module,v
retrieving revision 1.67
diff -u -p -r1.67 update.module
--- modules/update/update.module	18 May 2010 18:26:30 -0000	1.67
+++ modules/update/update.module	24 Sep 2010 01:21:59 -0000
@@ -670,7 +670,7 @@ function _update_cache_set($cid, $data, 
     'expire' => $expire,
   );
   if (!is_string($data)) {
-    $fields['data'] = serialize($data);
+    $fields['data'] = drupal_serialize($data);
     $fields['serialized'] = 1;
   }
   else {
@@ -695,7 +695,7 @@ function _update_cache_get($cid) {
   $cache = db_query("SELECT data, created, expire, serialized FROM {cache_update} WHERE cid = :cid", array(':cid' => $cid))->fetchObject();
   if (isset($cache->data)) {
     if ($cache->serialized) {
-      $cache->data = unserialize($cache->data);
+      $cache->data = drupal_unserialize($cache->data);
     }
   }
   return $cache;
@@ -716,7 +716,7 @@ function _update_get_cache_multiple($cid
   foreach ($result as $cache) {
     if ($cache) {
       if ($cache->serialized) {
-        $cache->data = unserialize($cache->data);
+        $cache->data = drupal_unserialize($cache->data);
       }
       $data[$cache->cid] = $cache;
     }
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1204
diff -u -p -r1.1204 user.module
--- modules/user/user.module	24 Sep 2010 00:37:45 -0000	1.1204
+++ modules/user/user.module	24 Sep 2010 01:22:05 -0000
@@ -265,7 +265,7 @@ class UserController extends DrupalDefau
     $picture_fids = array();
     foreach ($queried_users as $key => $record) {
       $picture_fids[] = $record->picture;
-      $queried_users[$key]->data = unserialize($record->data);
+      $queried_users[$key]->data = drupal_unserialize($record->data);
       $queried_users[$key]->roles = array();
       if ($record->uid) {
         $queried_users[$record->uid]->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user';
