Skip to content
Snippets Groups Projects
Commit 69266de5 authored by Dominik Eckelmann's avatar Dominik Eckelmann Committed by Adrian Lang
Browse files

fixed handling of MSG

msg() now stores always the message to the MSG array until headers are
sent. After this, a call of msg will print out all messages from the MSG
array immediately through html_msgarea.
This prevents double posting and losses of messages from the MSG array.
parent b0f6db0c
No related branches found
No related tags found
No related merge requests found
......@@ -265,17 +265,15 @@ function msg($message,$lvl=0,$line='',$file=''){
if($line || $file) $message.=' ['.basename($file).':'.$line.']';
if(!headers_sent()){
if(!isset($MSG)) $MSG = array();
$MSG[]=array('lvl' => $errors[$lvl], 'msg' => $message);
}else{
$MSG = array();
$MSG[]=array('lvl' => $errors[$lvl], 'msg' => $message);
if(!isset($MSG)) $MSG = array();
$MSG[]=array('lvl' => $errors[$lvl], 'msg' => $message);
if(headers_sent()){
if(function_exists('html_msgarea')){
html_msgarea();
}else{
print "ERROR($lvl) $message";
}
unset($GLOBALS['MSG']);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment