? 556018-rename-drupal-to-js-drupal-json_0.patch
? 556018-rename-drupal-to-js-drupal-json_1.patch
? locking-drupal_theme_rebuild.patch
? includes/.bootstrap.inc.swp
? modules/node/tests/node_access_test.info
? modules/node/tests/node_access_test.module
? modules/simpletest/tests/.session.test.swp
? sites/all/modules/cck
? sites/all/modules/devel
? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: includes/ajax.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/ajax.inc,v
retrieving revision 1.3
diff -u -p -r1.3 ajax.inc
--- includes/ajax.inc	21 Aug 2009 00:35:30 -0000	1.3
+++ includes/ajax.inc	22 Aug 2009 10:08:02 -0000
@@ -105,7 +105,7 @@
  *   A list of macro commands generated by the use of ajax_command_*()
  *   functions.
  * @param $header
- *   If set to FALSE the 'text/javascript' header used by drupal_json() will
+ *   If set to FALSE the 'text/javascript' header used by drupal_json_output() will
  *   not be used, which is necessary when using an IFRAME. If set to
  *   'multipart' the output will be wrapped in a textarea, which can also be
  *   used as an alternative method when uploading files.
@@ -123,17 +123,17 @@ function ajax_render($commands = array()
 
   // Use === here so that bool TRUE doesn't match 'multipart'.
   if ($header === 'multipart') {
-    // We do not use drupal_json() here because the header is not true. We are
+    // We do not use drupal_json_output() here because the header is not true. We are
     // not really returning JSON, strictly-speaking, but rather JSON content
     // wrapped in a textarea as per the "file uploads" example here:
     // http://malsup.com/jquery/form/#code-samples
-    print '<textarea>' . drupal_to_js($commands) . '</textarea>';
+    print '<textarea>' . drupal_json_encode($commands) . '</textarea>';
   }
   else if ($header) {
-    drupal_json($commands);
+    drupal_json_output($commands);
   }
   else {
-    print drupal_to_js($commands);
+    print drupal_json_encode($commands);
   }
   exit;
 }
Index: includes/batch.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/batch.inc,v
retrieving revision 1.36
diff -u -p -r1.36 batch.inc
--- includes/batch.inc	2 Jun 2009 06:58:15 -0000	1.36
+++ includes/batch.inc	22 Aug 2009 10:08:03 -0000
@@ -140,7 +140,7 @@ function _batch_do() {
   // Perform actual processing.
   list($percentage, $message) = _batch_process();
 
-  drupal_json(array('status' => TRUE, 'percentage' => $percentage, 'message' => $message));
+  drupal_json_output(array('status' => TRUE, 'percentage' => $percentage, 'message' => $message));
 }
 
 /**
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.965
diff -u -p -r1.965 common.inc
--- includes/common.inc	21 Aug 2009 07:50:07 -0000	1.965
+++ includes/common.inc	22 Aug 2009 10:08:13 -0000
@@ -3088,7 +3088,7 @@ function drupal_get_js($scope = 'header'
   foreach ($items as $item) {
     switch ($item['type']) {
       case 'setting':
-        $output .= '<script type="text/javascript">' . $embed_prefix . 'jQuery.extend(Drupal.settings, ' . drupal_to_js(call_user_func_array('array_merge_recursive', $item['data'])) . ");" . $embed_suffix . "</script>\n";
+        $output .= '<script type="text/javascript">' . $embed_prefix . 'jQuery.extend(Drupal.settings, ' . drupal_json_encode(call_user_func_array('array_merge_recursive', $item['data'])) . ");" . $embed_suffix . "</script>\n";
         break;
 
       case 'inline':
@@ -3420,7 +3420,7 @@ function drupal_clear_js_cache() {
  *
  * We use HTML-safe strings, i.e. with <, > and & escaped.
  */
-function drupal_to_js($var) {
+function drupal_json_encode($var) {
   // json_encode() does not escape <, > and &, so we do it with str_replace()
   return str_replace(array("<", ">", "&"), array('\x3c', '\x3e', '\x26'), json_encode($var));
 }
@@ -3434,12 +3434,12 @@ function drupal_to_js($var) {
  * @param $var
  *   (optional) If set, the variable will be converted to JSON and output.
  */
-function drupal_json($var = NULL) {
+function drupal_json_output($var = NULL) {
   // We are returning JavaScript, so tell the browser.
   drupal_set_header('Content-Type', 'text/javascript; charset=utf-8');
 
   if (isset($var)) {
-    echo drupal_to_js($var);
+    echo drupal_json_encode($var);
   }
 }
 
Index: includes/locale.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/locale.inc,v
retrieving revision 1.225
diff -u -p -r1.225 locale.inc
--- includes/locale.inc	21 Aug 2009 14:28:51 -0000	1.225
+++ includes/locale.inc	22 Aug 2009 10:08:17 -0000
@@ -2429,7 +2429,7 @@ function _locale_rebuild_js($langcode = 
       $data .= "'pluralFormula': function (\$n) { return Number({$language->formula}); }, ";
     }
 
-    $data .= "'strings': " . drupal_to_js($translations) . " };";
+    $data .= "'strings': " . drupal_json_encode($translations) . " };";
     $data_hash = md5($data);
   }
 
Index: modules/field/field.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.test,v
retrieving revision 1.42
diff -u -p -r1.42 field.test
--- modules/field/field.test	22 Aug 2009 00:58:52 -0000	1.42
+++ modules/field/field.test	22 Aug 2009 10:08:21 -0000
@@ -1365,7 +1365,7 @@ class FieldFormTestCase extends DrupalWe
     $this->drupalPost(NULL, $edit, $submit);
     unset($this->additionalCurlOptions[CURLOPT_URL]);
 
-    // The response is drupal_json, so we need to undo some escaping.
+    // The response is drupal_json_output, so we need to undo some escaping.
     $commands = json_decode(str_replace(array('\x3c', '\x3e', '\x26'), array("<", ">", "&"), $this->drupalGetContent()));
 
     // The JSON response will be two AJAX commands. The first is a settings
Index: modules/poll/poll.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.test,v
retrieving revision 1.22
diff -u -p -r1.22 poll.test
--- modules/poll/poll.test	17 Aug 2009 07:12:16 -0000	1.22
+++ modules/poll/poll.test	22 Aug 2009 10:08:22 -0000
@@ -344,7 +344,7 @@ class PollJSAddChoice extends DrupalWebT
     $this->drupalPost(NULL, $edit, t('More choices'));
     unset($this->additionalCurlOptions[CURLOPT_URL]);
 
-    // The response is drupal_json, so we need to undo some escaping.
+    // The response is drupal_json_output, so we need to undo some escaping.
     $commands = json_decode(str_replace(array('\x3c', '\x3e', '\x26'), array("<", ">", "&"), $this->drupalGetContent()));
 
     // The JSON response will be two AJAX commands. The first is a settings
Index: modules/profile/profile.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.admin.inc,v
retrieving revision 1.28
diff -u -p -r1.28 profile.admin.inc
--- modules/profile/profile.admin.inc	22 Aug 2009 09:22:01 -0000	1.28
+++ modules/profile/profile.admin.inc	22 Aug 2009 10:08:23 -0000
@@ -424,5 +424,5 @@ function profile_admin_settings_autocomp
   foreach ($result as $data) {
     $matches[$data->category] = check_plain($data->category);
   }
-  drupal_json($matches);
+  drupal_json_output($matches);
 }
Index: modules/profile/profile.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.pages.inc,v
retrieving revision 1.18
diff -u -p -r1.18 profile.pages.inc
--- modules/profile/profile.pages.inc	26 May 2009 10:41:06 -0000	1.18
+++ modules/profile/profile.pages.inc	22 Aug 2009 10:08:23 -0000
@@ -134,5 +134,5 @@ function profile_autocomplete($field, $s
     }
   }
 
-  drupal_json($matches);
+  drupal_json_output($matches);
 }
Index: modules/simpletest/tests/database_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/database_test.module,v
retrieving revision 1.9
diff -u -p -r1.9 database_test.module
--- modules/simpletest/tests/database_test.module	27 May 2009 18:34:00 -0000	1.9
+++ modules/simpletest/tests/database_test.module	22 Aug 2009 10:08:24 -0000
@@ -77,7 +77,7 @@ function database_test_menu() {
  */
 function database_test_db_query_temporary() {
   $table_name = db_query_temporary('SELECT status FROM {system}', array());
-  drupal_json(array(
+  drupal_json_output(array(
     'table_name' => $table_name,
     'row_count' => db_select($table_name)->countQuery()->execute()->fetchField(),
   ));
@@ -102,7 +102,7 @@ function database_test_even_pager_query(
 
   $names = $query->execute()->fetchCol();
 
-  drupal_json(array(
+  drupal_json_output(array(
     'names' => $names,
   ));
   exit;
@@ -126,7 +126,7 @@ function database_test_odd_pager_query($
 
   $names = $query->execute()->fetchCol();
 
-  drupal_json(array(
+  drupal_json_output(array(
     'names' => $names,
   ));
   exit;
@@ -155,7 +155,7 @@ function database_test_tablesort() {
   // We need all the results at once to check the sort.
   $tasks = $query->execute()->fetchAll();
 
-  drupal_json(array(
+  drupal_json_output(array(
     'tasks' => $tasks,
   ));
   exit;
@@ -184,7 +184,7 @@ function database_test_tablesort_first()
   // We need all the results at once to check the sort.
   $tasks = $query->execute()->fetchAll();
 
-  drupal_json(array(
+  drupal_json_output(array(
     'tasks' => $tasks,
   ));
   exit;
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.184
diff -u -p -r1.184 system.admin.inc
--- modules/system/system.admin.inc	22 Aug 2009 09:44:56 -0000	1.184
+++ modules/system/system.admin.inc	22 Aug 2009 10:08:30 -0000
@@ -1777,7 +1777,7 @@ function system_regional_settings_submit
  */
 function system_date_time_lookup() {
   $result = format_date(REQUEST_TIME, 'custom', $_GET['format']);
-  drupal_json($result);
+  drupal_json_output($result);
 }
 
 /**
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.759
diff -u -p -r1.759 system.module
--- modules/system/system.module	22 Aug 2009 09:44:56 -0000	1.759
+++ modules/system/system.module	22 Aug 2009 10:08:39 -0000
@@ -783,7 +783,7 @@ function system_menu() {
   );
   $items['admin/settings/clean-urls/check'] = array(
     'title' => 'Clean URL check',
-    'page callback' => 'drupal_json',
+    'page callback' => 'drupal_json_output',
     'page arguments' => array(array('status' => TRUE)),
     'access callback' => TRUE,
     'type' => MENU_CALLBACK,
@@ -2869,7 +2869,7 @@ function system_timezone($abbreviation =
   // interpreted as the empty string.
   $abbreviation = $abbreviation ? $abbreviation : '';
   $timezone = timezone_name_from_abbr($abbreviation, intval($offset), $is_daylight_saving_time);
-  drupal_json($timezone);
+  drupal_json_output($timezone);
 }
 
 /**
Index: modules/taxonomy/taxonomy.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.pages.inc,v
retrieving revision 1.32
diff -u -p -r1.32 taxonomy.pages.inc
--- modules/taxonomy/taxonomy.pages.inc	18 Aug 2009 06:01:07 -0000	1.32
+++ modules/taxonomy/taxonomy.pages.inc	22 Aug 2009 10:08:40 -0000
@@ -134,7 +134,7 @@ function taxonomy_autocomplete_legacy($v
     }
   }
 
-  drupal_json(array_merge($term_matches, $synonym_matches));
+  drupal_json_output(array_merge($term_matches, $synonym_matches));
 }
 
 /**
@@ -190,5 +190,5 @@ function taxonomy_autocomplete($field_na
     }
   }
 
-  drupal_json($term_matches);
+  drupal_json_output($term_matches);
 }
Index: modules/upload/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.251
diff -u -p -r1.251 upload.module
--- modules/upload/upload.module	21 Aug 2009 16:51:52 -0000	1.251
+++ modules/upload/upload.module	22 Aug 2009 10:08:41 -0000
@@ -641,7 +641,7 @@ function upload_js() {
   if (!($cached_form = form_get_cache($_POST['form_build_id'], $cached_form_state)) || !isset($cached_form['#node']) || !isset($cached_form['attachments'])) {
     form_set_error('form_token', t('Validation error, please try again. If this error persists, please contact the site administrator.'));
     $output = theme('status_messages');
-    print drupal_to_js(array('status' => TRUE, 'data' => $output));
+    print drupal_json_encode(array('status' => TRUE, 'data' => $output));
     exit();
   }
 
Index: modules/user/user.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.pages.inc,v
retrieving revision 1.48
diff -u -p -r1.48 user.pages.inc
--- modules/user/user.pages.inc	12 Aug 2009 12:36:05 -0000	1.48
+++ modules/user/user.pages.inc	22 Aug 2009 10:08:43 -0000
@@ -18,7 +18,7 @@ function user_autocomplete($string = '')
     }
   }
 
-  drupal_json($matches);
+  drupal_json_output($matches);
 }
 
 /**
