Skip to content

Commit

Permalink
Added a check for email prefix before accessing it (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peterburnett authored Sep 9, 2020
1 parent 1520f90 commit b1e2239
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions classes/local/envbarlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,11 @@ public static function config() {

// Email subject prefix.
if (get_config('local_envbar', 'enableemailprefix')) {
$origprefix = $CFG->emailsubjectprefix;
$CFG->emailsubjectprefix = '[' . substr($match->showtext, 0, 4) . '] ' . $origprefix;
// Only do something if this config exists.
if (isset($CFG->emailsubjectprefix)) {
$origprefix = $CFG->emailsubjectprefix;
$CFG->emailsubjectprefix = '[' . substr($match->showtext, 0, 4) . '] ' . $origprefix;
}
}
}

Expand Down

0 comments on commit b1e2239

Please sign in to comment.