? boost-621054.patch
? boost-621148.patch
Index: boost.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v
retrieving revision 1.3.2.2.2.5.2.222
diff -u -p -r1.3.2.2.2.5.2.222 boost.module
--- boost.module	2 Nov 2009 18:45:07 -0000	1.3.2.2.2.5.2.222
+++ boost.module	2 Nov 2009 19:18:55 -0000
@@ -857,15 +857,12 @@ function boost_block($op = 'list', $delt
               $output .= t('Cache Generated: %time seconds<br />', array('%time' => round($generate, 2))) . ' ';
               $output .=  drupal_get_form('boost_block_flush_form');
             }
-            $error = FALSE;
-            if (function_exists('error_get_last')) {
-              $error = error_get_last();
-            }
+            $error = _boost_page_have_error();
             $drupal_msg = max(count(drupal_get_messages(NULL, FALSE)), $GLOBALS['_boost_message_count']);
 
-            if ((BOOST_HALT_ON_ERRORS && $error) || (BOOST_HALT_ON_MESSAGES && $drupal_msg != 0)) {
+            if ($error || (BOOST_HALT_ON_MESSAGES && $drupal_msg != 0)) {
               $output = t('There are <strong>php errors</strong> or <strong>drupal messages</strong> on this page, preventing boost from caching.') . ' ';
-              if (BOOST_HALT_ON_ERRORS && $error) {
+              if ($error) {
                 $output .= t('ERROR: <pre>%error</pre> !link <br /> !performance', array('%error' => boost_print_r($error, TRUE), '!link' => l(t('Lookup Error Type'), 'http://php.net/errorfunc.constants'), '!performance' => l(t('Turn Off Error Checking'), 'admin/settings/performance')));
               }
               if (BOOST_HALT_ON_MESSAGES && $drupal_msg != 0) {
@@ -1201,21 +1198,10 @@ function _boost_ob_handler() {
   }
 
   // Check for PHP errors
-  if (function_exists('error_get_last')) {
-    if (BOOST_HALT_ON_ERRORS && $error = error_get_last()) {
-    switch ($error['type']) {
-      case E_NOTICE: //Ignore run-time notices
-      case E_USER_NOTICE: //Ignore user-generated notice message
-      //case E_DEPRECATED: //Ignore run-time notices
-      //case E_USER_DEPRECATED: //Ignore user-generated notice message
-        break;
-      default: //Do not cache page on all other errors
-        $GLOBALS['_boost_cache_this'] = FALSE;
-        if (BOOST_VERBOSE >= 3) {
-          watchdog('boost', 'There are <strong>php errors</strong> on this page, preventing boost from caching. ERROR: <pre>%error</pre> !link <br /> !performance', array('%error' => boost_print_r($error, TRUE), '!link' => l(t('Lookup Error Type'), 'http://php.net/errorfunc.constants'), '!performance' => l(t('Turn Off Error Checking'), 'admin/settings/performance/boost')), WATCHDOG_WARNING);
-        }
-        break;
-      }
+  if ($error = _boost_page_have_error()) {
+    $GLOBALS['_boost_cache_this'] = FALSE;
+    if (BOOST_VERBOSE >= 3) {
+      watchdog('boost', 'There are <strong>php errors</strong> on this page, preventing boost from caching. ERROR: <pre>%error</pre> !link <br /> !performance', array('%error' => boost_print_r($error, TRUE), '!link' => l(t('Lookup Error Type'), 'http://php.net/errorfunc.constants'), '!performance' => l(t('Turn Off Error Checking'), 'admin/settings/performance/boost')), WATCHDOG_WARNING);
     }
   }
 
@@ -2957,6 +2943,29 @@ function _boost_copy_file_get_domains($d
 }
 
 /**
+ * Get PHP error if it exists.
+ */
+function _boost_page_have_error() {
+  if (function_exists('error_get_last')) {
+    if (BOOST_HALT_ON_ERRORS && $error = error_get_last()) {
+    switch ($error['type']) {
+      case E_NOTICE: //Ignore run-time notices
+      case E_USER_NOTICE: //Ignore user-generated notice message
+      //case E_DEPRECATED: //Ignore run-time notices
+      //case E_USER_DEPRECATED: //Ignore user-generated notice message
+        return FALSE;
+        break;
+      default: //Do not cache page on all other errors
+        $GLOBALS['_boost_cache_this'] = FALSE;
+        return $error;
+        break;
+      }
+    }
+  }
+  return FALSE;
+}
+
+/**
  * Gets page_callback & page_arguments from menu_router table
  *
  * Allows for any content type to have it's own cache expiration.
@@ -3160,7 +3169,6 @@ ETO;
     _boost_mkdir_p(dirname($filename));
     file_put_contents($filename, gzencode($string, 9));
   }
-
 }
 
 /**
