From 0037dcc99b0e6ca7098349155365cdfb4dca7f83 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Tue, 5 Jan 2010 20:31:42 +0000 Subject: [PATCH] MDL-21251 set up correct debugging in ABORT_AFTER_CONFIG scripts --- lib/setup.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/setup.php b/lib/setup.php index 254497cd53..a7fc4e717e 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -50,6 +50,18 @@ $CFG->yui3version = '3.0.0'; // special support for highly optimised scripts that do not need libraries and DB connection if (defined('ABORT_AFTER_CONFIG')) { if (!defined('ABORT_AFTER_CONFIG_CANCEL')) { + // hide debugging if not enabled in config.php - we do not want to disclose sensitive info + if (isset($CFG->debug)) { + error_reporting($CFG->debug); + } else { + error_reporting(0); + } + if (empty($CFG->debugdisplay)) { + @ini_set('display_errors', '0'); + @ini_set('log_errors', '1'); + } else { + @ini_set('display_errors', '1'); + } require_once("$CFG->dirroot/lib/configonlylib.php"); return; } -- 2.39.5