Skip to content
Permalink
Browse files

Adding defense checking for msgs.

  • Loading branch information
Peter Adams
Peter Adams committed Mar 21, 2020
1 parent c47f945 commit 93919b3bb6857b0c4e32282fbc0bf4d31ec5504a
Showing with 15 additions and 59 deletions.
  1. +15 −10 owa_base.php
  2. +0 −49 owa_wp.php
@@ -90,20 +90,25 @@ function getMsg($code, $substitutions = []) {

static $_owa_messages;

$msg = array();

if (empty($_owa_messages)) {
require_once(OWA_DIR.'conf/messages.php');
}

if ( $code && array_key_exists( $code, $_owa_messages ) ) {

$msg = $_owa_messages[$code];

$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 (isset($msg['headline'])) {
$msg['headline'] = vsprintf($msg['headline'], $substitutions['headline']);
}

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

return $msg;
}

This file was deleted.

0 comments on commit 93919b3

Please sign in to comment.
You can’t perform that action at this time.