X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=1b9710bb8057afb5a247e5d9400949173d6ed9ed;hb=3b7adf43576db24e516716bb13a2bd0bac677c8c;hp=1c9820ccefa1bf57fe3b31984f4db6a2d83e5504;hpb=c7326fa0883c1a45b7364426be58fd0a24fe085c;p=mailer.git
diff --git a/inc/functions.php b/inc/functions.php
index 1c9820ccef..1b9710bb80 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -346,14 +346,18 @@ function translateComma ($dotted, $cut = true, $max = '0') {
// First, cast all to double, due to PHP changes
$dotted = (double) $dotted;
- // Default is 3 you can change this in admin area "Misc -> Misc Options"
- if (!isConfigEntrySet('max_comma')) setConfigEntry('max_comma', 3);
+ // Default is 3 you can change this in admin area "Settings -> Misc Options"
+ if (!isConfigEntrySet('max_comma')) {
+ setConfigEntry('max_comma', 3);
+ } // END - if
// Use from config is default
$maxComma = getConfig('max_comma');
// Use from parameter?
- if ($max > 0) $maxComma = $max;
+ if ($max > 0) {
+ $maxComma = $max;
+ } // END - if
// Cut zeros off?
if (($cut === true) && ($max == '0')) {
@@ -550,17 +554,8 @@ function redirectToUrl ($URL, $allowSpider = true) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'URL=' . $URL);
//* DEBUG: */ die($URL);
- // Simple probe for bots/spiders from search engines
- if ((isSpider()) && ($allowSpider === true)) {
- // Set HTTP-Status
- setHttpStatus('200 OK');
-
- // Set content-type here to fix a missing array element
- setContentType('text/html');
-
- // Output new location link as anchor
- outputHtml('' . secureString($URL) . '');
- } elseif (!headers_sent()) {
+ // We should not sent a redirect if headers are already sent
+ if (!headers_sent()) {
// Clear output buffer
clearOutputBuffer();
@@ -634,9 +629,9 @@ function array_pk_sort (&$array, $a_sort, $primary_key = '0', $order = -1, $nums
//
// Deprecated : $length (still has one reference in this function)
-// Optional : $DATA
+// Optional : $extraData
//
-function generateRandomCode ($length, $code, $userid, $DATA = '') {
+function generateRandomCode ($length, $code, $userid, $extraData = '') {
// Build server string
$server = $_SERVER['PHP_SELF'] . getEncryptSeperator() . detectUserAgent() . getEncryptSeperator() . getenv('SERVER_SOFTWARE') . getEncryptSeperator() . detectRealIpAddress() . getEncryptSeperator() . detectRemoteAddr();
@@ -654,7 +649,7 @@ function generateRandomCode ($length, $code, $userid, $DATA = '') {
} // END - if
// Build string from misc data
- $data = $code . getEncryptSeperator() . $userid . getEncryptSeperator() . $DATA;
+ $data = $code . getEncryptSeperator() . $userid . getEncryptSeperator() . $extraData;
// Add more additional data
if (isSessionVariableSet('u_hash')) {
@@ -722,7 +717,7 @@ function bigintval ($num, $castValue = true, $abortOnMismatch = true) {
}
// Creates a Uni* timestamp from given selection data and prefix
-function createTimestampFromSelections ($prefix, $postData) {
+function createEpocheTimeFromSelections ($prefix, $postData) {
// Initial return value
$ret = '0';
@@ -732,7 +727,9 @@ function createTimestampFromSelections ($prefix, $postData) {
$M1 = getMonth();
// If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
- if ((floor($TEST) == $TEST) && ($M1 == '02') && ($postData[$prefix . '_mo'] > '02')) $SWITCH = getOneDay();
+ if ((floor($TEST) == $TEST) && ($M1 == '02') && ($postData[$prefix . '_mo'] > '02')) {
+ $SWITCH = getOneDay();
+ } // END - if
// First add years...
$ret += $postData[$prefix . '_ye'] * (31536000 + $SWITCH);
@@ -1463,7 +1460,7 @@ function handleExtraValues ($filterFunction, $value, $extraValue) {
}
// Converts timestamp selections into a timestamp
-function convertSelectionsToTimestamp (&$postData, &$DATA, &$id, &$skip) {
+function convertSelectionsToEpocheTime (array &$postData, array &$DATA, &$id, &$skip) {
// Init test variable
$skip = false;
$test2 = '';
@@ -1477,7 +1474,7 @@ function convertSelectionsToTimestamp (&$postData, &$DATA, &$id, &$skip) {
$test = substr($id, 0, -3);
if ((isset($postData[$test.'_ye'])) && (isset($postData[$test.'_mo'])) && (isset($postData[$test.'_we'])) && (isset($postData[$test.'_da'])) && (isset($postData[$test.'_ho'])) && (isset($postData[$test.'_mi'])) && (isset($postData[$test.'_se'])) && ($test != $test2)) {
// Generate timestamp
- $postData[$test] = createTimestampFromSelections($test, $postData);
+ $postData[$test] = createEpocheTimeFromSelections($test, $postData);
$DATA[] = sprintf("`%s`='%s'", $test, $postData[$test]);
$GLOBALS['skip_config'][$test] = true;
@@ -2217,7 +2214,7 @@ function generateAdminMailLinks ($mailType, $mailId) {
if (SQL_NUMROWS($result) == 1) {
// Load the entry
$content = SQL_FETCHARRAY($result);
- die(__FUNCTION__.':
content=
'.print_r($content, true).''); + die('Unfinished area:
'.print_r($content, true).''); } // END - if // Free result