? favicon.patch
? favicon_mimetypes_531476_7_0.diff
? sites/default/files
? sites/default/settings.php
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.500
diff -u -p -r1.500 theme.inc
--- includes/theme.inc	27 Jul 2009 18:38:35 -0000	1.500
+++ includes/theme.inc	28 Jul 2009 17:19:38 -0000
@@ -1041,6 +1041,7 @@ function theme_get_settings($key = NULL)
     'logo_path'                        =>  '',
     'default_favicon'                  =>  1,
     'favicon_path'                     =>  '',
+    'favicon_mimetype'                 =>  'image/vnd.microsoft.icon',
     'main_menu'                        =>  1,
     'secondary_menu'                   =>  1,
     'toggle_logo'                      =>  1,
@@ -1888,11 +1889,7 @@ function template_preprocess_page(&$vari
   // Add favicon.
   if (theme_get_setting('toggle_favicon')) {
     $favicon = theme_get_setting('favicon');
-    $type = file_get_mimetype($favicon);
-    // Use the genereic MIME type for favicons if no other was found.
-    if ($type == 'application/octet-stream') {
-      $type = 'image/x-icon';
-    }
+    $type = theme_get_setting('favicon_mimetype');
     drupal_add_html_head('<link rel="shortcut icon" href="' . check_url($favicon) . '" type="' . check_plain($type) . '" />');
   }
 
Index: includes/theme.maintenance.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.maintenance.inc,v
retrieving revision 1.32
diff -u -p -r1.32 theme.maintenance.inc
--- includes/theme.maintenance.inc	14 Jul 2009 10:22:17 -0000	1.32
+++ includes/theme.maintenance.inc	28 Jul 2009 17:19:38 -0000
@@ -216,11 +216,7 @@ function template_preprocess_maintenance
   // Add favicon
   if (theme_get_setting('toggle_favicon')) {
     $favicon = theme_get_setting('favicon');
-    $type = file_get_mimetype($favicon);
-    // Use the genereic MIME type for favicons if no other was found.
-    if ($type == 'application/octet-stream') {
-      $type = 'image/x-icon';
-    }
+    $type = theme_get_setting('favicon_mimetype');
     drupal_add_html_head('<link rel="shortcut icon" href="' . check_url($favicon) . '" type="' . check_plain($type) . '" />');
   }
 
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.163
diff -u -p -r1.163 system.admin.inc
--- modules/system/system.admin.inc	20 Jul 2009 18:51:34 -0000	1.163
+++ modules/system/system.admin.inc	28 Jul 2009 17:19:38 -0000
@@ -507,6 +507,13 @@ function system_theme_settings(&$form_st
  */
 function system_theme_settings_submit($form, &$form_state) {
   $values = $form_state['values'];
+  if (empty($values['default_favicon']) && !empty($values['favicon_path'])) {
+    $mimetype = file_get_mimetype($values['favicon_path']);
+    // Use the default MIME type for favicons if no other was found.
+    if ($mimetype != 'application/octet-stream') {
+      $values['favicon_mimetype'] = $mimetype;
+    }
+  }
   $key = $values['var'];
 
   // Exclude unnecessary elements before saving.
