Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.381
diff -u -p -r1.381 bootstrap.inc
--- includes/bootstrap.inc	29 Apr 2010 05:03:28 -0000	1.381
+++ includes/bootstrap.inc	29 Apr 2010 15:00:21 -0000
@@ -59,6 +59,31 @@ define('CACHE_DISABLED', 0);
 define('CACHE_NORMAL', 1);
 
 /**
+ * @name error_reporting Error reporting levels
+ * @{
+ * Flags for use in the 'error_level' system variable.
+ */
+
+/**
+ * Error reporting level: display no errors.
+ */
+define('ERROR_REPORTING_HIDE', 0);
+
+/**
+ * Error reporting level: display errors and warnings.
+ */
+define('ERROR_REPORTING_DISPLAY_SOME', 1);
+
+/**
+ * Error reporting level: display all messages.
+ */
+define('ERROR_REPORTING_DISPLAY_ALL', 2);
+
+/**
+ * @} End of "name error_reporting".
+ */
+
+/**
  * Log message severity -- Emergency: system is unusable.
  *
  * @see watchdog()
@@ -595,7 +620,7 @@ function drupal_settings_initialize() {
     // to use the same session identifiers across http and https.
     list( , $session_name) = explode('://', $base_url, 2);
     // HTTP_HOST can be modified by a visitor, but we already sanitized it
-    // in drupal_settings_initialize().
+    // in drupal_environment_initialize().
     if (!empty($_SERVER['HTTP_HOST'])) {
       $cookie_domain = $_SERVER['HTTP_HOST'];
       // Strip leading periods, www., and port numbers from cookie domain.
@@ -623,6 +648,10 @@ function drupal_settings_initialize() {
   }
   $prefix = ini_get('session.cookie_secure') ? 'SSESS' : 'SESS';
   session_name($prefix . md5($session_name));
+
+  // Lastly, set PHP's display_errors according to Drupal's error_level setting.
+  $error_level = variable_get('error_level', ERROR_REPORTING_DISPLAY_ALL);
+  ini_set('display_errors', (int) $error_level != ERROR_REPORTING_HIDE);
 }
 
 /**
Index: includes/errors.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/errors.inc,v
retrieving revision 1.5
diff -u -p -r1.5 errors.inc
--- includes/errors.inc	11 Apr 2010 18:33:43 -0000	1.5
+++ includes/errors.inc	29 Apr 2010 14:57:26 -0000
@@ -7,21 +7,6 @@
  */
 
 /**
- * Error reporting level: display no errors.
- */
-define('ERROR_REPORTING_HIDE', 0);
-
-/**
- * Error reporting level: display errors and warnings.
- */
-define('ERROR_REPORTING_DISPLAY_SOME', 1);
-
-/**
- * Error reporting level: display all messages.
- */
-define('ERROR_REPORTING_DISPLAY_ALL', 2);
-
-/**
  * Map PHP error constants to watchdog severity levels.
  * The error constants are documented at
  * http://php.net/manual/en/errorfunc.constants.php
