]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
Deprecated action=login (admin area) removed
[mailer.git] / inc / wrapper-functions.php
index bed3c34916a04f6bd33c80a21738e181de978602..7068fdc8bb5baee5a5d0b658101fd58d621ccfe5 100644 (file)
@@ -44,6 +44,12 @@ if (!defined('__SECURITY')) {
 
 // Read a given file
 function readFromFile ($FQFN, $sqlPrepare = false) {
+       // Sanity-check if file is there (should be there, but just to make it sure)
+       if (!isFileReadable($FQFN)) {
+               // This should not happen
+               debug_report_bug(__FUNCTION__.': File ' . basename($FQFN) . ' is not readable!');
+       } // END - if
+
        // Load the file
        if (function_exists('file_get_contents')) {
                // Use new function
@@ -280,24 +286,24 @@ function isInstalling () {
 function isInstalled () {
        return (
        (
-       // New config file found and loaded
-       getConfig('MXCHANGE_INSTALLED') == 'Y'
-       ) || (
-       // Fall-back!
-       isIncludeReadable('inc/config.php')
+               // New config file found and loaded
+               getConfig('MXCHANGE_INSTALLED') == 'Y'
        ) || (
-       (
-       // New config file found, but not yet read
-       isIncludeReadable('inc/cache/config-local.php')
-       ) && (
-       (
-       // Only new config file is found
-       !isIncludeReadable('inc/config.php')
+               // Fall-back!
+               isIncludeReadable('inc/config.php')
        ) || (
-       // Is installation mode
-       isInstalling()
-       )
-       )
+               (
+                       // New config file found, but not yet read
+                       isIncludeReadable('inc/cache/config-local.php')
+               ) && (
+                       (
+                               // Only new config file is found
+                               !isIncludeReadable('inc/config.php')
+                       ) || (
+                               // Is installation mode
+                               isInstalling()
+                       )
+               )
        )
        );
 }
@@ -319,6 +325,12 @@ function isDebugModeEnabled () {
        return (getConfig('DEBUG_MODE') == 'Y');
 }
 
+// Checks wether we shall debug regular expressions
+function isDebugRegExpressionEnabled () {
+       // Simply check it
+       return (getConfig('DEBUG_REGEX') == 'Y');
+}
+
 // Checks wether the cache instance is valid
 function isCacheInstanceValid () {
        return ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])));
@@ -372,7 +384,7 @@ function sendHeader ($header) {
        } // END - if
 
        // Send the header
-       header($header);
+       header(trim($header));
 }
 
 // Wrapper function for chmod()