X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffunctions.php;h=545a2f2eb41823b76000be5e197cb823262656a8;hp=9589c5e15cb849b91656a23e10d8f899f1ac6255;hb=ff21321f09918909f7e21f850b6617156323e332;hpb=2ec9007220186d54f84846871ed1f7638c29baf7 diff --git a/inc/functions.php b/inc/functions.php index 9589c5e15c..545a2f2eb4 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -114,7 +114,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) { sendHeader('Connection: Close'); // Extension 'rewrite' installed? - if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) { + if ((EXT_IS_ACTIVE('rewrite')) && (getOutputMode() != '1') && (getOutputMode() != '-1')) { $OUTPUT = rewriteLinksInCode($OUTPUT); } // END - if @@ -137,7 +137,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) { outputRawCode($OUTPUT); } elseif ((getConfig('OUTPUT_MODE') == 'render') && (!empty($OUTPUT))) { // Rewrite links when rewrite extension is active - if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) { + if ((EXT_IS_ACTIVE('rewrite')) && (getOutputMode() != '1') && (getOutputMode() != '-1')) { $OUTPUT = rewriteLinksInCode($OUTPUT); } // END - if @@ -300,13 +300,13 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) { //////////////////////// $FQFN = $basePath . $mode . $template . '.tpl'; - if ((!empty($GLOBALS['what'])) && ((strpos($template, '_header') > 0) || (strpos($template, '_footer') > 0)) && (($mode == 'guest/') || ($mode == 'member/') || ($mode == 'admin/'))) { + if ((isWhatSet()) && ((strpos($template, '_header') > 0) || (strpos($template, '_footer') > 0)) && (($mode == 'guest/') || ($mode == 'member/') || ($mode == 'admin/'))) { // Select what depended header/footer template file for admin/guest/member area $file2 = sprintf("%s%s%s_%s.tpl", $basePath, $mode, $template, - SQL_ESCAPE($GLOBALS['what']) + getWhat() ); // Probe for it... @@ -735,7 +735,10 @@ function generateCaptchaCode ($code, $type, $DATA, $uid) { // Loads an email template and compiles it function LOAD_EMAIL_TEMPLATE ($template, $content = array(), $UID = '0') { - global $DATA, $_CONFIG; + global $DATA; + + // Our configuration is kept non-global here + $_CONFIG = getConfigArray(); // Make sure all template names are lowercase! $template = strtolower($template); @@ -1671,7 +1674,7 @@ function ADD_EMAIL_NAV ($PAGES, $offset, $show_form, $colspan, $return=false) { $NAV .= "-"; } else { // Open anchor tag and add base URL - $NAV .= "loadCacheFile('revision')) $new = true; + if (REQUEST_ISSET_GET('check_revision_data') && REQUEST_GET('check_revision_data') == 'yes') { + // Force rebuild by URL parameter + $new = true; + } elseif (( + !isset($GLOBALS['cache_array']['revision'][$type]) + ) || ( + count($GLOBALS['cache_array']['revision']) < 3 + ) || ( + !$GLOBALS['cache_instance']->loadCacheFile('revision') + )) { + // Out-dated cache + $new = true; + } // END - if // Is the cache file outdated/invalid? if ($new === true){ - $GLOBALS['cache_instance']->destroyCacheFile(); // @TODO isn't it better to do $GLOBALS['cache_instance']->destroyCacheFile('revision')? + // Destroy cache file + $GLOBALS['cache_instance']->destroyCacheFile(); // @TODO shouldn't do the unset and the reloading $GLOBALS['cache_instance']->destroyCacheFile() Or a new methode like forceCacheReload('revision')? unset($GLOBALS['cache_array']['revision']); // Reload load_cach-revison.php loadInclude('inc/loader/load_cache-revision.php'); + + // Abort here + return; } // END - if // Return found value return $GLOBALS['cache_array']['revision'][$type][0]; - } else { // Old Version without ext-cache active (deprecated ?) @@ -2476,7 +2500,7 @@ function getActualVersion ($type = 'Revision') { // Check if REQUEST_GET('check_revision_data') is setted (switch for manually rewrite the .revision-File) if ((REQUEST_ISSET_GET('check_revision_data')) && (REQUEST_GET('check_revision_data') == 'yes')) { - // Has changed! + // Forced rebuild of .revision file $new = true; } else { // Check for revision file @@ -2619,7 +2643,7 @@ function debug_report_bug ($message = '') { } // END - if // Add output - $debug .= "Please report this bug at bugs.mxchange.org and include the logfile from inc/cache/debug.log in your report (you cannot attach files!):
";
+	$debug .= "Please report this bug at bugs.mxchange.org and include the logfile from inc/cache/debug.log in your report (you can now attach files):
";
 	$debug .= debug_get_printable_backtrace();
 	$debug .= "
\nRequest-URI: " . $_SERVER['REQUEST_URI']."
\n"; $debug .= "Thank you for finding bugs."; @@ -2891,7 +2915,7 @@ function DEBUG_LOG ($funcFile, $line, $message, $force=true) { // Log this message away $fp = fopen(constant('PATH')."inc/cache/debug.log", 'a') or app_die(__FUNCTION__, __LINE__, "Cannot write logfile debug.log!"); - fwrite($fp, date("d.m.Y|H:i:s", time())."|" . $GLOBALS['module']."|".basename($funcFile)."|" . $line."|".strip_tags($message)."\n"); + fwrite($fp, date("d.m.Y|H:i:s", time())."|" . getModule()."|".basename($funcFile)."|" . $line."|".strip_tags($message)."\n"); fclose($fp); } // END - if } @@ -3260,7 +3284,7 @@ function isUserIdSet () { // Handle message codes from URL function handleCodeMessage () { if (REQUEST_ISSET_GET('msg')) { - // Default extension is "unknown" + // Default extension is 'unknown' $ext = 'unknown'; // Is extension given?