? boost-491968.patch
? boost-510892.patch
Index: boost.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v
retrieving revision 1.3.2.2.2.5.2.68
diff -u -p -r1.3.2.2.2.5.2.68 boost.module
--- boost.module	3 Jul 2009 18:32:39 -0000	1.3.2.2.2.5.2.68
+++ boost.module	6 Jul 2009 04:52:51 -0000
@@ -400,7 +400,7 @@ function boost_block($op = 'list', $delt
             if (BOOST_HALT_ON_ERRORS && ($error || $drupal_msg != 0)) {
               $output = t('There are <strong>php errors</strong> or <strong>drupal messages</strong> on this page, preventing boost from caching.');
               if ($error) {
-                $output .= t(' ERROR: <pre>%error</pre> !link <br /> !performance', array('%error' => 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')));
+                $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 ($drupal_msg != 0) {
                 $output .= t(' MESSAGES: %msg <br /> !performance', array('%msg' => $drupal_msg, '!performance' => l(t('Turn Off Error Checking'), 'admin/settings/performance')));
@@ -467,13 +467,13 @@ function _boost_ob_handler($buffer) {
   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_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;
+        break;
       default: //Do not cache page on all other errors
-        watchdog('boost', 'There are <strong>php errors</strong> on this page, preventing boost from caching. ERROR: <pre>%error</pre> !link <br /> !performance', array('%error' => 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')), WATCHDOG_WARNING);
+        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')), WATCHDOG_WARNING);
         return $buffer;
       }
     }
@@ -1038,6 +1038,7 @@ function boost_db_is_expired($filename) 
 /**
  * Sets a special cookie preventing authenticated users getting served pages
  * from the static page cache.
+ *
  * @param $user
  *   User Object
  * @param $expires
@@ -1114,6 +1115,60 @@ function boost_cache_css_js_files($buffe
   }
 }
 
+/**
+ * An alternative to print_r that unlike the original does not use output buffering with
+ * the return parameter set to true. Thus, Fatal errors that would be the result of print_r
+ * in return-mode within ob handlers can be avoided.
+ * http://www.php.net/manual/en/function.print-r.php#75872
+ *
+ * Comes with an extra parameter to be able to generate html code. If you need a
+ * human readable DHTML-based print_r alternative, see http://krumo.sourceforge.net/
+ *
+ * Support for printing of objects as well as the $return parameter functionality
+ * added by Fredrik Wollsén (fredrik dot motin at gmail), to make it work as a drop-in
+ * replacement for print_r (Except for that this function does not output
+ * paranthesises around element groups... ;) )
+ *
+ * Based on return_array() By Matthew Ruivo (mruivo at gmail)
+ * (http://www.php.net/manual/en/function.print-r.php#73436)
+ */
+function boost_print_r($var, $return = false, $html = false, $level = 0) {
+  $spaces = "";
+  $space = $html ? "&nbsp;" : " ";
+  $newline = $html ? "<br />" : "\n";
+  for ($i = 1; $i <= 6; $i++) {
+    $spaces .= $space;
+  }
+  $tabs = $spaces;
+  for ($i = 1; $i <= $level; $i++) {
+    $tabs .= $spaces;
+  }
+  if (is_array($var)) {
+    $title = "Array";
+  }
+  elseif (is_object($var)) {
+    $title = get_class($var)." Object";
+  }
+  $output = $title . $newline . $newline;
+
+  // Recursive boost_print_r
+  foreach($var as $key => $value) {
+    if (is_array($value) || is_object($value)) {
+      $level++;
+      $value = boost_print_r($value, true, $html, $level);
+      $level--;
+    }
+    $output .= $tabs . "[" . $key . "] => " . $value . $newline;
+  }
+
+  if ($return) {
+    return $output;
+  }
+  else {
+    echo $output;
+  }
+}
+
 //////////////////////////////////////////////////////////////////////////////
 // Boost API internals
 /**
