]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
Fixed a typo, thanks to profi-concept. Function INCLUDE_READABLE() introduced
[mailer.git] / inc / functions.php
index 591a56c702a432cd908f76714cba97d5b76506a2..38612873b25b6a9be882b1929a991055823ea0c6 100644 (file)
@@ -2392,13 +2392,13 @@ function merge_array ($array1, $array2) {
        }
 
        // Both are not arrays
-       debug_report_bug(__FUNCTION__.":");
+       debug_report_bug(__FUNCTION__.": No arrays provided!");
 }
 
 // Debug message logger
 function DEBUG_LOG ($file, $line, $message, $force=true) {
        // Is debug mode enabled?
-       if ((isBooleanConstantAndTrue('DEBUG_MODE')) || ($force)) {
+       if ((isBooleanConstantAndTrue('DEBUG_MODE')) || ($force === true)) {
                // Log this message away
                $fp = fopen(PATH."inc/cache/debug.log", 'a') or mxchange_die("Cannot write logfile debug.log!");
                fwrite($fp, date("d.m.Y|H:i:s", time())."|".basename($file)."|".$line."|".strip_tags($message)."\n");
@@ -2628,7 +2628,7 @@ function REBUILD_CACHE ($cache, $inc="") {
                        $INC = sprintf("inc/loader/load_cache-%s.php", $inc);
 
                        // Is the include there?
-                       if (FILE_READABLE($INC)) {
+                       if (INCLUDE_READABLE($INC)) {
                                // And rebuild it from scratch
                                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): inc={$inc} - LOADED!<br />\n";
                                LOAD_INC($INC);
@@ -2672,7 +2672,7 @@ function TRANSLATE_POOL_TYPE ($type) {
        // Does it exist?
        if (defined($constName)) {
                // Then use it
-               $translated = constant($constName);
+               $translated = getMessage($constName);
        } // END - if
 
        // Return "translation"
@@ -3241,7 +3241,7 @@ function convertCodeToMessage ($code) {
                case constant('CODE_COOKIES_DISABLED') : $msg = getMessage('LOGIN_NO_COOKIES'); break;
                case constant('CODE_BEG_SAME_AS_OWN')  : $msg = getMessage('BEG_SAME_UID_AS_OWN'); break;
                case constant('CODE_LOGIN_FAILED')     : $msg = getMessage('LOGIN_FAILED_GENERAL'); break;
-               default                                : $msg = UNKNOWN_MAILID_CODE_1.$code.UNKNOWN_MAILID_CODE_2; break;
+               default                                : $msg = sprintf(getMessage('UNKNOWN_MAILID_CODE'), $code); break;
        } // END - switch
 
        // Return the message
@@ -3286,6 +3286,15 @@ function GENERATE_AID_LINK ($aid) {
        return $admin;
 }
 
+// Checks wether an include file (non-FQFN better) is readable
+function INCLUDE_READABLE ($INC) {
+       // Construct FQFN
+       $FQFN = constant('PATH') . $INC;
+
+       // Is it readable?
+       return FILE_READABLE($FQFN);
+}
+
 //////////////////////////////////////////////////
 // AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
 //////////////////////////////////////////////////