X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffunctions.php;h=9681a3020a5f7a3b36b88aa3b41931ed41e438ed;hp=99ff9804f5ebc9e3fea65fc32852eb39ed54374f;hb=e8ca54fe91872ab95a6ffdc4f1268bf18889021d;hpb=63df9c12fbba3f9bb621843329cd5ad38ca070b2 diff --git a/inc/functions.php b/inc/functions.php index 99ff9804f5..9681a3020a 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -149,7 +149,9 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = ' } // END - if // Fix HTML parameter (default is no!) - if (empty($isHtml)) $isHtml = 'N'; + if (empty($isHtml)) { + $isHtml = 'N'; + } // END - if // Debug mode enabled? if (isDebugModeEnabled()) { @@ -259,7 +261,7 @@ function sendRawEmail ($toEmail, $subject, $message, $headers) { // Generate a password in a specified length or use default password length function generatePassword ($length = '0') { // Auto-fix invalid length of zero - if ($length == '0') $length = getConfig('pass_len'); + if ($length == '0') $length = getPassLen(); // Initialize array with all allowed chars $ABC = explode(',', 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9,-,+,_,/,.'); @@ -1703,9 +1705,7 @@ function logDebugMessage ($funcFile, $line, $message, $force=true) { $message = str_replace("\r", '', str_replace("\n", '', $message)); // Log this message away - $fp = fopen(getCachePath() . 'debug.log', 'a') or debug_report_bug(__FUNCTION__, __LINE__, 'Cannot write logfile debug.log!'); - fwrite($fp, generateDateTime(time(), '4') . '|' . getModule(false) . '|' . basename($funcFile) . '|' . $line . '|' . $message . "\n"); - fclose($fp); + appendLineToFile(getCachePath() . 'debug.log', generateDateTime(time(), '4') . '|' . getModule(false) . '|' . basename($funcFile) . '|' . $line . '|' . $message); } // END - if } @@ -2140,19 +2140,13 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = false, $ad // Remove both for extension name $extName = substr($baseFile, strlen($prefix), -4); - // Is the extension valid and active? - if (isExtensionNameValid($extName)) { - // Then add this file - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Extension entry ' . $baseFile . ' added.'); + // Add file with or without base path + if ($addBaseDir === true) { + // With base path $files[] = $fileName; } else { - // Add non-extension files as well - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Regular entry ' . $baseFile . ' added.'); - if ($addBaseDir === true) { - $files[] = $fileName; - } else { - $files[] = $baseFile; - } + // No base path + $files[] = $baseFile; } } else { // We found .php file but should not search for them, why? @@ -2241,7 +2235,7 @@ function initCacheInstance () { $GLOBALS['cache_instance'] = new CacheSystem(); // Did it work? - if ($GLOBALS['cache_instance']->getStatus() != 'done') { + if ($GLOBALS['cache_instance']->getStatusCode() != 'done') { // Failed to initialize cache sustem addFatalMessage(__FUNCTION__, __LINE__, '(' . __LINE__ . '): {--CACHE_CANNOT_INITIALIZE--}'); } // END - if