Index: index.php
===================================================================
RCS file: /cvs/drupal/drupal/index.php,v
retrieving revision 1.94
diff -u -r1.94 index.php
--- index.php	26 Dec 2007 08:46:48 -0000	1.94
+++ index.php	12 Feb 2008 01:44:11 -0000
@@ -15,8 +15,21 @@
 require_once './includes/bootstrap.inc';
 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
 
+// Need to cache the unthemed flag in the session, so it will effect
+// the results page that follows a form submission.
+if (isset($_GET['unthemed'])) {
+  $_SESSION['unthemed'] = $_GET['unthemed'];
+}
+
+// This call will not return on form submission.
 $return = menu_execute_active_handler();
 
+// Move the unthemed flag back out of the session.
+if (isset($_SESSION['unthemed'])) {
+  $unthemed = $_SESSION['unthemed'];
+  unset($_SESSION['unthemed']);
+}
+
 // Menu status constants are integers; page content is a string.
 if (is_int($return)) {
   switch ($return) {
@@ -32,8 +45,14 @@
   }
 }
 elseif (isset($return)) {
-  // Print any value (including an empty string) except NULL or undefined:
-  print theme('page', $return);
+  if (isset($unthemed)) {
+    print theme ('unthemed_page', $return); 
+  }
+  else {
+    // Print any value (including an empty string) except NULL or undefined:
+    print theme('page', $return);
+  }
 }
 
+// Not sure if this should be called if $unthemed is true?
 drupal_page_footer();
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.756
diff -u -r1.756 common.inc
--- includes/common.inc	30 Jan 2008 23:07:41 -0000	1.756
+++ includes/common.inc	12 Feb 2008 01:44:11 -0000
@@ -2844,6 +2844,11 @@
     'install_page' => array(
       'arguments' => array('content' => NULL),
     ),
+    'unthemed_page' => array(
+      'arguments' => array('content' => NULL),
+      'template' => 'unthemed-page',
+    ),
+    
     'task_list' => array(
       'arguments' => array('items' => NULL, 'active' => NULL),
     ),
@@ -3556,3 +3561,4 @@
   }
   variable_set('css_js_query_string', $new_character . substr($string_history, 0, 19));
 }
+
Index: modules/system/unthemed-page.tpl.php
===================================================================
RCS file: modules/system/unthemed-page.tpl.php
diff -N modules/system/unthemed-page.tpl.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/system/unthemed-page.tpl.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,16 @@
+<?php
+// $Id:$
+
+/**
+ * @file unthemed-page.tpl.php
+ *
+ * Show the raw content of the page as an html fragment.
+ *
+ */
+?>
+<div id="raw">
+  <div id="title"><?php print drupal_get_title(); ?></div>
+  <div id="messages"><?php print theme('status_messages'); ?></div>
+  <div id="path"><?php print $_GET['q']; ?></div>
+  <div id="content"><?php print $content; ?></div>
+</div>
