diff --git a/owa_base.php b/owa_base.php index eb2f874e9..3255354e4 100644 --- a/owa_base.php +++ b/owa_base.php @@ -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;