Skip to content

Commit

Permalink
fixing undefined index warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Adams committed Apr 4, 2020
1 parent 8183061 commit c1bfb81
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions owa_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,16 @@ function getMsg($code, $substitutions = []) {
if ( $code && array_key_exists( $code, $_owa_messages ) ) {

$msg = $_owa_messages[$code];

if (isset($msg['headline'])) {
$msg['headline'] = vsprintf($msg['headline'], $substitutions['headline']);
}

if (isset($msg['message'])) {
$msg['message'] = vsprintf($msg['message'], $substitutions['message']);
}

if ( $substitutions ) {
if (isset($msg['headline'])) {
$msg['headline'] = vsprintf($msg['headline'], $substitutions['headline']);
}

if (isset($msg['message'])) {
$msg['message'] = vsprintf($msg['message'], $substitutions['message']);
}
}
}

return $msg;
Expand Down

0 comments on commit c1bfb81

Please sign in to comment.