Skip to content

Commit

Permalink
Merge branch 'MDL-66169-master' of https://github.com/snake/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Sep 25, 2019
2 parents 31b822e + cddbdb2 commit e8a2d53
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions admin/testoutgoingmailconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
// Manage Moodle debugging options.
$debuglevel = $CFG->debug;
$debugdisplay = $CFG->debugdisplay;
$debugsmtp = $CFG->debugsmtp;
$debugsmtp = $CFG->debugsmtp ?? null; // This might not be set as it's optional.
$CFG->debugdisplay = true;
$CFG->debugsmtp = true;
$CFG->debug = 15;
Expand All @@ -66,7 +66,12 @@
// Restore Moodle debugging options.
$CFG->debug = $debuglevel;
$CFG->debugdisplay = $debugdisplay;
$CFG->debugsmtp = $debugsmtp;

// Restore the debugsmtp config, if it was set originally.
unset($CFG->debugsmtp);
if (!is_null($debugsmtp)) {
$CFG->debugsmtp = $debugsmtp;
}

if ($success) {
$msgparams = new stdClass();
Expand Down

0 comments on commit e8a2d53

Please sign in to comment.