=== modified file 'includes/common.inc'
--- includes/common.inc	2009-10-05 02:48:38 +0000
+++ includes/common.inc	2009-10-07 15:06:28 +0000
@@ -3417,12 +3417,6 @@ function drupal_get_js($scope = 'header'
   // page request.
   $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1);
 
-  // For inline Javascript to validate as XHTML, all Javascript containing
-  // XHTML needs to be wrapped in CDATA. To make that backwards compatible
-  // with HTML 4, we need to comment out the CDATA-tag.
-  $embed_prefix = "\n<!--//--><![CDATA[//><!--\n";
-  $embed_suffix = "\n//--><!]]>\n";
-
   // Sort the JavaScript by weight so that it appears in the correct order.
   uasort($items, 'drupal_sort_weight');
 
@@ -3430,16 +3424,18 @@ 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_json_encode(call_user_func_array('array_merge_recursive', $item['data'])) . ");" . $embed_suffix . "</script>\n";
+        $output .= theme('script', 'jQuery.extend(Drupal.settings, ' . drupal_json_encode(call_user_func_array('array_merge_recursive', $item['data'])) . ");") ."\n";
         break;
 
       case 'inline':
-        $output .= '<script type="text/javascript"' . ($item['defer'] ? ' defer="defer"' : '') . '>' . $embed_prefix . $item['data'] . $embed_suffix . "</script>\n";
+        $attributes = $item['defer'] ? array('defer' => 'defer') : array();
+        $output .= theme('script', $item['data'], $attributes) . "\n";
         break;
 
       case 'file':
         if (!$item['preprocess'] || !$is_writable || !$preprocess_js) {
-          $no_preprocess .= '<script type="text/javascript"' . ($item['defer'] ? ' defer="defer"' : '') . ' src="' . file_create_url($item['data']) . ($item['cache'] ? $query_string : '?' . REQUEST_TIME) . "\"></script>\n";
+          $attributes = $item['defer'] ? array('src' => file_create_url($item['data']) . ($item['cache'] ? $query_string : '?' . REQUEST_TIME), 'defer' => 'defer') : array('src' => file_create_url($item['data']) . ($item['cache'] ? $query_string : '?' . REQUEST_TIME));
+          $no_preprocess .= theme('script', NULL, $attributes) . "\n";
         }
         else {
           $files[$item['data']] = $item;
@@ -3448,7 +3444,8 @@ function drupal_get_js($scope = 'header'
 
       case 'external':
         // Preprocessing for external JavaScript files is ignored.
-        $output .= '<script type="text/javascript"' . ($item['defer'] ? ' defer="defer"' : '') . ' src="' . check_plain($item['data']) . "\"></script>\n";
+        $attributes = $item['defer'] ? array('src' => check_plain($item['data']), 'defer' => 'defer') : array('src' => check_plain($item['data']));
+        $output .= theme('script', NULL, $attributes) . "\n";
         break;
     }
   }
@@ -3459,7 +3456,7 @@ function drupal_get_js($scope = 'header'
     // starting with "ad*".
     $filename = 'js_' . md5(serialize($files) . $query_string) . '.js';
     $preprocess_file = file_create_url(drupal_build_js_cache($files, $filename));
-    $preprocessed .= '<script type="text/javascript" src="' . $preprocess_file . '"></script>' . "\n";
+    $preprocessed .= theme('script', NULL, array('src' => $preprocess_file)) . "\n";
   }
 
   // Keep the order of JS files consistent as some are preprocessed and others are not.
@@ -4868,6 +4865,9 @@ function drupal_common_theme() {
     'indentation' => array(
       'arguments' => array('size' => 1),
     ),
+    'script' => array(
+      'arguments' => array('script' => NULL, 'attributes' => array()),
+    ),
     // from pager.inc
     'pager' => array(
       'arguments' => array('tags' => array(), 'element' => 0, 'parameters' => array(), 'quantity' => 9),

=== modified file 'includes/theme.inc'
--- includes/theme.inc	2009-10-05 02:43:01 +0000
+++ includes/theme.inc	2009-10-07 16:54:39 +0000
@@ -256,7 +256,7 @@ function _theme_load_registry($theme, $b
   else {
     // If not, build one and cache it.
     $registry = _theme_build_registry($theme, $base_theme, $theme_engine);
-   // Only persist this registry if all modules are loaded. This assures a 
+   // Only persist this registry if all modules are loaded. This assures a
    // complete set of theme hooks.
     if (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL) {
       _theme_save_registry($theme, $registry);
@@ -2019,6 +2019,33 @@ function theme_indentation($size = 1) {
 }
 
 /**
+ * Return a <script> tag.
+ *
+ * @param $script
+ *   A string containing a script.
+ * @param $attributes
+ *   An associative array of HTML attributes.
+ * @return
+ *   A string containing a <script> tag.
+ */
+function theme_script($script = NULL, array $attributes = array()) {
+
+  // Set a default value for the type.
+  if(!isset($attributes['type'])){
+    $attributes['type'] = 'text/javascript';
+  }
+
+  if (isset($script)) {
+    // For inline Javascript to validate as XHTML, all Javascript containing
+    // XHTML needs to be wrapped in CDATA. To make that backwards compatible
+    // with HTML 4, we need to comment out the CDATA-tag.
+    $script = "\n<!--//--><![CDATA[//><!--\n" . $script . "\n//--><!]]>\n";
+  }
+
+  return '<script' . drupal_attributes($attributes) . '>' . $script . '</script>';
+}
+
+/**
  * @} End of "defgroup themeable".
  */
 
@@ -2128,7 +2155,7 @@ function template_preprocess_html(&$vari
   else {
     $variables['classes_array'][] = 'no-sidebars';
   }
-  
+
   // Populate the body classes.
   if ($suggestions = template_page_suggestions(arg(), 'page')) {
     foreach ($suggestions as $suggestion) {
@@ -2140,7 +2167,7 @@ function template_preprocess_html(&$vari
       }
     }
   }
-  
+
   // If on an individual node page, add the node type to body classes.
   if ($node = menu_get_object()) {
     $variables['classes_array'][] = drupal_html_class('node-type-' . $node->type);
@@ -2172,7 +2199,7 @@ function template_preprocess_html(&$vari
     }
   }
   $variables['head_title'] = implode(' | ', $head_title);
-  
+
   // Populate the page template suggestions.
   if ($suggestions = template_page_suggestions(arg(), 'html')) {
     $variables['template_files'] = $suggestions;

=== modified file 'modules/system/system.module'
--- modules/system/system.module	2009-10-05 02:43:01 +0000
+++ modules/system/system.module	2009-10-07 15:02:38 +0000
@@ -1664,7 +1664,7 @@ function system_admin_menu_block($item) 
   $has_subitems = FALSE;
   $result = db_query("
     SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.theme_callback, m.theme_arguments, m.type, m.description, m.path, m.weight as router_weight, ml.*
-    FROM {menu_router} m 
+    FROM {menu_router} m
     LEFT JOIN {menu_links} ml ON m.path = ml.router_path
     WHERE (ml.plid = :plid AND ml.menu_name = :name AND hidden = 0) OR (m.tab_parent = :path AND m.type IN (:local_task, :default_task))", array(':plid' => $item['mlid'], ':name' => $item['menu_name'], ':path' => $item['path'], ':local_task' => MENU_LOCAL_TASK, ':default_task' => MENU_DEFAULT_LOCAL_TASK), array('fetch' => PDO::FETCH_ASSOC));
   foreach ($result as $link) {
@@ -1698,7 +1698,7 @@ function system_admin_menu_block($item) 
     }
   }
   if ($has_subitems) {
-    // If we've had at least one non-tab subitem, remove the link for the 
+    // If we've had at least one non-tab subitem, remove the link for the
     // default task, since that is already broken down to subitems.
     unset($content[$default_task]);
   }

