--- apc.module.old	2011-01-05 14:18:53.716991003 +0100
+++ apc.module	2011-01-05 14:20:06.160991001 +0100
@@ -63,11 +63,8 @@ function apc_shutdown() {
   global $apc_statistics;
 
   // Try not to break non-HTML pages.
-  if (function_exists('drupal_get_headers')) {
-    $headers = drupal_get_headers();
-    if(strstr($headers, 'xml') || strstr($headers, 'javascript') || strstr($headers, 'plain')) {
-      return;
-    }
+  if(strstr(drupal_get_html_head(), 'text/html') == FALSE) {
+    return;
   }
 
   print '<div id="apc-devel"><h2>' . t('APC statistics') . '</h2>';
