X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fwrapper-functions.php;h=308f7439a6b589421729f0fabed41f4b50deb8f0;hp=1c3e2b60d1f61690bbc7f7a8ab7dda538c804c8a;hb=3971209b0996a1b0506d6ddaf7326432933eae1b;hpb=f8cc979307416fbd9b27908ec461004a3feb9387 diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 1c3e2b60d1..308f7439a6 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -481,33 +481,6 @@ function copyFileVerified ($source, $dest, $chmod = '') { return $status; } -// Wrapper function for header() -// Send a header but checks before if we can do so -function sendHeader ($header) { - // Send the header - //* DEBUG: */ logDebugMessage(__FUNCTION__ . ': header=' . $header); - $GLOBALS['header'][] = trim($header); -} - -// Flushes all headers -function flushHeaders () { - // Is the header already sent? - if (headers_sent()) { - // Then abort here - debug_report_bug(__FUNCTION__, __LINE__, 'Headers already sent!'); - } // END - if - - // Flush all headers if found - if ((isset($GLOBALS['header'])) && (is_array($GLOBALS['header']))) { - foreach ($GLOBALS['header'] as $header) { - header($header); - } // END - foreach - } // END - if - - // Mark them as flushed - $GLOBALS['header'] = array(); -} - // Wrapper function for chmod() // @TODO Do some more sanity check here function changeMode ($FQFN, $mode) { @@ -1148,10 +1121,10 @@ function sendRawRedirect ($url) { (preg_match('|^Microsoft-IIS/(\d)\.\d$|', trim($_SERVER['SERVER_SOFTWARE']), $matches)) && ($matches[1] < 6)) { // Send the IIS header - sendHeader('Refresh: 0;url=' . $url); + addHttpHeader('Refresh: 0;url=' . $url); } else { // Send generic header - sendHeader('Location: ' . $url); + addHttpHeader('Location: ' . $url); } // Shutdown here @@ -2669,16 +2642,23 @@ function convertCommaToDotInPostDataArray ($postEntries) { * @link http://de.php.net/manual/en/function.floatval.php#92563 */ function parseFloat ($floatString){ - $LocaleInfo = localeconv(); - $floatString = str_replace($LocaleInfo['mon_thousands_sep'] , '', $floatString); - $floatString = str_replace($LocaleInfo['mon_decimal_point'] , '.', $floatString); - return floatval($floatString); + // Load locale info + $LocaleInfo = localeconv(); + + // Remove thousand separators + $floatString = str_replace($LocaleInfo['mon_thousands_sep'] , '' , $floatString); + + // Convert decimal point + $floatString = str_replace($LocaleInfo['mon_decimal_point'] , '.', $floatString); + + // Return float value of converted string + return floatval($floatString); } // Generates a YES/NO option list from given default -function generateYesNoOptionList ($configValue = '') { +function generateYesNoOptionList ($defaultValue = '') { // Generate it - return generateOptionList('/ARRAY/', array('Y', 'N'), array('{--YES--}', '{--NO--}'), $configValue); + return generateOptionList('/ARRAY/', array('Y', 'N'), array('{--YES--}', '{--NO--}'), $defaultValue); } // "Getter" for total available receivers