X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=fd8b2c5a9074c4fd388e3bb1999e6ed4f35ade1c;hb=27f65d023a3388a8bd85be8ee5991f776f541847;hp=591f12976bfae3e57a08f8a04c7e0efa0747d1c8;hpb=9270eabb4c34f6fe04d56e7e702cf000849358d3;p=mailer.git diff --git a/inc/functions.php b/inc/functions.php index 591f12976b..fd8b2c5a90 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -137,6 +137,18 @@ function OUTPUT_HTML($HTML, $NEW_LINE = true) { break; } } elseif ((_OB_CACHING == "on") && ($footer == 1)) { + // Headers already sent? + if (headers_sent()) { + // Log this error + DEBUG_LOG(__FUNCTION__, __LINE__, "Headers already sent! We need debug backtrace here."); + + // Output debug trace + print("Headers are already sent!
\n"); + print("Please report this error at bugs.mxchange.org:
");
+			debug_print_backtrace();
+			die("
Thank you for your help finding bugs."); + } // END - if + // Output cached HTML code $OUTPUT = ob_get_contents(); @@ -2581,6 +2593,7 @@ function REVERT_COMMA ($str) { // Return float return $float; } + // Handle menu-depending failed logins and return the rendered content function HANDLE_LOGIN_FAILTURES ($accessLevel) { // Default output is empty ;-) @@ -2609,6 +2622,7 @@ function HANDLE_LOGIN_FAILTURES ($accessLevel) { // Return rendered content return $OUT; } + // Rebuild cache function REBUILD_CACHE ($cache, $inc="") { global $cacheInstance, $CSS; @@ -2638,6 +2652,7 @@ function REBUILD_CACHE ($cache, $inc="") { } // END - if } // END - if } + // Purge admin menu cache function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") { global $cacheInstance; @@ -2656,8 +2671,9 @@ function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") { } // Experiemental feature! - trigger_error("You have to delete the admin_*.cache files by yourself at this point."); + trigger_error("Experimental feature: You have to delete the admin_*.cache files by yourself at this point."); } + // Translates the "pool type" into human-readable function TRANSLATE_POOL_TYPE ($type) { // Default type is unknown @@ -2675,6 +2691,7 @@ function TRANSLATE_POOL_TYPE ($type) { // Return "translation" return $translated; } + // "Getter" for remote IP number function GET_REMOTE_ADDR () { // Get remote ip from environment @@ -2961,12 +2978,16 @@ function THEME_GET_ID ($name) { return $id; } -// Increment or init with 1 the given config entry -function incrementConfigEntry ($configEntry) { +// Increment or init with given value or 1 as default the given config entry +function incrementConfigEntry ($configEntry, $value=1) { global $_CONFIG; // Increment it if set or init it with 1 - if (getConfig($configEntry) > 0) { $_CONFIG[$configEntry]++; } else { $_CONFIG[$configEntry] = 1; } + if (getConfig($configEntry) > 0) { + $_CONFIG[$configEntry] += $value; + } else { + $_CONFIG[$configEntry] = $value; + } } //////////////////////////////////////////////////