X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffunctions.php;h=6635ab0a6e672c2307207b1575129e70a0868df1;hp=a292a5b1bce53c775c69869d2d4f78c3b9dea785;hb=d016e24dd4686f613a17733b96bc28fac936a4ac;hpb=5ae157f2010b3aae3c6f2ecdc6ec7c30b305be4a diff --git a/inc/functions.php b/inc/functions.php index a292a5b1bc..6635ab0a6e 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -181,10 +181,13 @@ function OUTPUT_RAW ($HTML) { } // END - if } +// Init fatal message array +function initFatalMessages () { + $GLOBALS['fatal_messages'] = array(); +} + // Add a fatal error message to the queue array function addFatalMessage ($message, $extra="") { - global $FATAL; - if (is_array($extra)) { // Multiple extras for a message with masks $message = call_user_func_array('sprintf', $extra); @@ -193,8 +196,8 @@ function addFatalMessage ($message, $extra="") { $message = sprintf($message, $extra); } - // Add message to $FATAL - $FATAL[] = $message; + // Add message to $GLOBALS['fatal_messages'] + $GLOBALS['fatal_messages'][] = $message; // Log fatal messages away DEBUG_LOG(__FUNCTION__, __LINE__, " message={$message}"); @@ -202,15 +205,13 @@ function addFatalMessage ($message, $extra="") { // Getter for total fatal message count function getTotalFatalErrors () { - global $FATAL; - // Init coun $count = 0; // Do we have at least the first entry? - if (!empty($FATAL[0])) { + if (!empty($GLOBALS['fatal_messages'][0])) { // Get total count - $count = count($FATAL); + $count = count($GLOBALS['fatal_messages']); } // END - if // Return value @@ -746,7 +747,7 @@ function SET_LANGUAGE ($lang) { } // function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") { - global $DATA, $REPLACER, $_CONFIG; + global $DATA, $_CONFIG; // Make sure all template names are lowercase! $template = strtolower($template); @@ -964,17 +965,16 @@ function LOAD_CONFIGURED_URL ($configEntry) { // function COMPILE_CODE($code, $simple = false, $constants = true, $full = true) { - global $SEC_CHARS, $URL_CHARS; // Is the code a string? if (!is_string($code)) { // Silently return it return $code; } // END - if - $ARRAY = $SEC_CHARS; + $ARRAY = $GLOBALS['security_chars']; // Select smaller set of chars to replace when we e.g. want to compile URLs - if (!$full) $ARRAY = $URL_CHARS; + if (!$full) $ARRAY = $GLOBALS['url_chars']; // Compile constants if ($constants) {