mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-15413 warn admins if display_errors enabled
This commit is contained in:
parent
a2d51ba880
commit
b373260475
@ -568,6 +568,10 @@
|
||||
print_box(get_string('datarootsecuritywarning', 'admin', $CFG->dataroot), 'generalbox adminwarning');
|
||||
}
|
||||
|
||||
if (defined('WARN_DISPLAY_ERRORS_ENABLED')) {
|
||||
print_box(get_string('displayerrorswarning', 'admin'), 'generalbox adminwarning');
|
||||
}
|
||||
|
||||
if (substr($CFG->wwwroot, -1) == '/') {
|
||||
print_box(get_string('cfgwwwrootslashwarning', 'admin'), 'generalbox adminwarning');
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ $ADMIN->add('server', $temp);
|
||||
// "debugging" settingpage
|
||||
$temp = new admin_settingpage('debugging', get_string('debugging', 'admin'));
|
||||
$temp->add(new admin_setting_special_debug());
|
||||
$temp->add(new admin_setting_configcheckbox('debugdisplay', get_string('debugdisplay', 'admin'), get_string('configdebugdisplay', 'admin'), ini_get('display_errors')));
|
||||
$temp->add(new admin_setting_configcheckbox('debugdisplay', get_string('debugdisplay', 'admin'), get_string('configdebugdisplay', 'admin'), ini_get_bool('display_errors')));
|
||||
$temp->add(new admin_setting_configcheckbox('xmlstrictheaders', get_string('xmlstrictheaders', 'admin'), get_string('configxmlstrictheaders', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugsmtp', get_string('debugsmtp', 'admin'), get_string('configdebugsmtp', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('perfdebug', get_string('perfdebug', 'admin'), get_string('configperfdebug', 'admin'), '7', '15', '7'));
|
||||
|
@ -302,6 +302,7 @@ $string['denyemailaddresses'] = 'Denied email domains';
|
||||
$string['digestmailtime'] = 'Hour to send digest emails';
|
||||
$string['disablecourseajax'] = 'Disable AJAX course editing';
|
||||
$string['disableuserimages'] = 'Disable User Profile Images';
|
||||
$string['displayerrorswarning'] = 'Enabling the PHP setting <em>display_errors</em> is not recommended on production sites because some error messages may reveal sensitive information about your server.';
|
||||
$string['displayloginfailures'] = 'Display login failures to';
|
||||
$string['docroot'] = 'Moodle Docs document root';
|
||||
$string['doctonewwindow'] = 'Open in new window';
|
||||
|
@ -215,6 +215,10 @@ global $HTTPSPAGEREQUIRED;
|
||||
error_reporting($CFG->debug);
|
||||
|
||||
|
||||
/// find out if PHP cofigured to display warnings
|
||||
if (ini_get_bool('display_errors')) {
|
||||
define('WARN_DISPLAY_ERRORS_ENABLED', true);
|
||||
}
|
||||
/// If we want to display Moodle errors, then try and set PHP errors to match
|
||||
if (!isset($CFG->debugdisplay)) {
|
||||
//keep it as is during installation
|
||||
|
@ -6910,7 +6910,7 @@ function debugging($message='', $level=DEBUG_NORMAL, $backtrace=null) {
|
||||
}
|
||||
$from = print_backtrace($backtrace, true);
|
||||
if (!isset($CFG->debugdisplay)) {
|
||||
$CFG->debugdisplay = ini_get('display_errors');
|
||||
$CFG->debugdisplay = ini_get_bool('display_errors');
|
||||
}
|
||||
if ($CFG->debugdisplay) {
|
||||
if (!defined('DEBUGGING_PRINTED')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user