]> git.mxchange.org Git - mailer.git/blobdiff - inc/fatal_errors.php
HTML->XHTML preparation (still *A LOT* to convert
[mailer.git] / inc / fatal_errors.php
index 6bb6a0ca55886cdc5ec99f641497f1e3f7d0ff27..a3a476ca543d5afcbe8069890861785aac2094c4 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
 
-if ((sizeof($FATAL) > 0) || (!empty($FATAL[0])))
-{
+if (getTotalFatalErrors() > 0) {
        // Main div container
        LOAD_TEMPLATE("fatal_header");
 
@@ -48,7 +46,7 @@ if ((sizeof($FATAL) > 0) || (!empty($FATAL[0])))
        if (isBooleanConstantAndTrue('mxchange_installing')) {
                // While we are installing ouput other header than while it is installed... :-)
                $OUT = "";
-               foreach ($FATAL as $key=>$value) {
+               foreach ($FATAL as $key => $value) {
                        // Prepare content for the template
                        $content = array(
                                'key'   => ($key + 1),
@@ -64,7 +62,7 @@ if ((sizeof($FATAL) > 0) || (!empty($FATAL[0])))
        } elseif (isBooleanConstantAndTrue('mxchange_installed')) {
                // Display all runtime fatal errors
                $OUT = "";
-               foreach ($FATAL as $key=>$value) {
+               foreach ($FATAL as $key => $value) {
                        // Prepare content for the template
                        $content = array(
                                'key'   => ($key + 1),
@@ -78,12 +76,14 @@ if ((sizeof($FATAL) > 0) || (!empty($FATAL[0])))
                // Load main template
                mxchange_die(LOAD_TEMPLATE("runtime_fatal_table", true, $OUT));
        }
+
+       // Message to regular users (non-admin)
        $CORR = FATAL_REPORT_ERRORS;
 
        // PHP warnings fixed
        if ($check == "done") {
                if (IS_ADMIN()) $CORR = FATAL_CORRECT_ERRORS;
-       }
+       } // END - if
 
        // Load footer template
        LOAD_TEMPLATE("fatal_footer", false, $CORR);