]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
Bad things are now 'classified' as bad (CSS class 'bad' is being used instead of...
[mailer.git] / inc / wrapper-functions.php
index 557f7e2d3d0d51d742d6f666224ec88f67e575ec..29638a8fc99c9d2fe42fe582c3f603d16c0f0ab2 100644 (file)
@@ -17,7 +17,7 @@
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -127,15 +127,13 @@ function clearOutputBuffer () {
 }
 
 // Encode strings
-// @TODO Implement $compress
-function encodeString ($str, $compress = true) {
+function encodeString ($str) {
        $str = urlencode(base64_encode(compileUriCode($str)));
        return $str;
 }
 
 // Decode strings encoded with encodeString()
-// @TODO Implement $decompress
-function decodeString ($str, $decompress = true) {
+function decodeString ($str) {
        $str = compileUriCode(base64_decode(urldecode(compileUriCode($str))));
        return $str;
 }
@@ -172,7 +170,7 @@ function isFileReadable ($FQFN) {
        // Do we have cache?
        if (!isset($GLOBALS['file_readable'][$FQFN])) {
                // Check all...
-               $GLOBALS['file_readable'][$FQFN] = ((file_exists($FQFN)) && (is_file($FQFN)) && (is_readable($FQFN)));
+               $GLOBALS['file_readable'][$FQFN] = ((is_file($FQFN)) && (file_exists($FQFN)) && (is_readable($FQFN)));
        } // END - if
 
        // Return result
@@ -313,7 +311,7 @@ function isInstalling () {
        // Determine wether we are installing
        if (!isset($GLOBALS['mailer_installing'])) {
                // Check URL (css.php/js.php need this)
-               $GLOBALS['mailer_installing'] = isGetRequestParameterSet('installing');
+               $GLOBALS['mailer_installing'] = isGetRequestElementSet('installing');
        } // END - if
 
        // Return result
@@ -542,9 +540,9 @@ function removeFile ($FQFN) {
 // Wrapper for $_POST['sel']
 function countPostSelection ($element = 'sel') {
        // Is it set?
-       if (isPostRequestParameterSet($element)) {
+       if (isPostRequestElementSet($element)) {
                // Return counted elements
-               return countSelection(postRequestParameter($element));
+               return countSelection(postRequestElement($element));
        } else {
                // Return zero if not found
                return 0;
@@ -561,7 +559,7 @@ function isNicknameUsed ($userid) {
        // Is the cache there
        if (!isset($GLOBALS[__FUNCTION__][$userid])) {
                // Determine it
-               $GLOBALS[__FUNCTION__][$userid] = ((!empty($userid)) && (('' . round($userid) . '') != $userid));
+               $GLOBALS[__FUNCTION__][$userid] = ((!empty($userid)) && (('' . round($userid) . '') != $userid) && ($userid != 'NULL'));
        } // END - if
 
        // Return the result
@@ -742,8 +740,8 @@ function isBlockModeEnabled () {
 }
 
 /**
- * Wrapper function for addPointsThroughReferalSystem(), you should generally
- * avoid this function and use addPointsThroughReferalSystem() directly and add
+ * Wrapper function for addPointsThroughReferralSystem(), you should generally
+ * avoid this function and use addPointsThroughReferralSystem() directly and add
  * your special payment method entry to points_data instead.
  *
  * @param      $subject        A string-encoded subject for this add
@@ -753,10 +751,10 @@ function isBlockModeEnabled () {
  */
 function addPointsDirectly ($subject, $userid, $points) {
        // Reset level here
-       initReferalSystem();
+       initReferralSystem();
 
        // Call more complicated method (due to more parameters)
-       return addPointsThroughReferalSystem($subject, $userid, $points, false, 0, 'DIRECT');
+       return addPointsThroughReferralSystem($subject, $userid, $points, false, 0, 'DIRECT');
 }
 
 // Wrapper for redirectToUrl but URL comes from a configuration entry
@@ -1146,7 +1144,7 @@ function sendRawRedirect ($url) {
 
        // check if running on IIS < 6 with CGI-PHP
        if ((isset($_SERVER['SERVER_SOFTWARE'])) && (isset($_SERVER['GATEWAY_INTERFACE'])) &&
-               (strpos($_SERVER['GATEWAY_INTERFACE'], 'CGI') !== false) &&
+               (isInString('CGI', $_SERVER['GATEWAY_INTERFACE'])) &&
                (preg_match('|^Microsoft-IIS/(\d)\.\d$|', trim($_SERVER['SERVER_SOFTWARE']), $matches)) &&
                ($matches[1] < 6)) {
                // Send the IIS header
@@ -1548,8 +1546,8 @@ function isAdminNotificationEnabled () {
        return $GLOBALS[__FUNCTION__];
 }
 
-// Checks wether random referal id selection is enabled
-function isRandomReferalIdEnabled () {
+// Checks wether random referral id selection is enabled
+function isRandomReferralIdEnabled () {
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
@@ -1572,7 +1570,7 @@ function getDefaultLanguage () {
        return $GLOBALS[__FUNCTION__];
 }
 
-// "Getter" for default referal id
+// "Getter" for default referral id
 function getDefRefid () {
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
@@ -1680,12 +1678,12 @@ function getPrime () {
        return $GLOBALS[__FUNCTION__];
 }
 
-// "Getter" for encrypt_seperator
-function getEncryptSeperator () {
+// "Getter" for encrypt_separator
+function getEncryptSeparator () {
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = getConfig('ENCRYPT_SEPERATOR');
+               $GLOBALS[__FUNCTION__] = getConfig('ENCRYPT_SEPARATOR');
        } // END - if
 
        // Return cache
@@ -2477,7 +2475,7 @@ function ifPostContainsSelections ($element = 'sel') {
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__][$element])) {
                // Determine it
-               $GLOBALS[__FUNCTION__][$element] = ((isPostRequestParameterSet($element)) && (countPostSelection($element) > 0));
+               $GLOBALS[__FUNCTION__][$element] = ((isPostRequestElementSet($element)) && (countPostSelection($element) > 0));
        } // END - if
 
        // Return cache
@@ -2631,10 +2629,10 @@ function createConfigurationTimeSelections ($configEntry, $stamps, $align = 'cen
 // Shortens converting of German comma to Computer's version in POST data
 function convertCommaToDotInPostData ($postEntry) {
        // Read and convert given entry
-       $postValue = convertCommaToDot(postRequestParameter($postEntry));
+       $postValue = convertCommaToDot(postRequestElement($postEntry));
 
        // ... and set it again
-       setPostRequestParameter($postEntry, $postValue);
+       setPostRequestElement($postEntry, $postValue);
 }
 
 // Converts German commas to Computer's version in all entries
@@ -2642,7 +2640,7 @@ function convertCommaToDotInPostDataArray ($postEntries) {
        // Replace german decimal comma with computer decimal dot
        foreach ($postEntries as $entry) {
                // Is the entry there?
-               if (isPostRequestParameterSet($entry)) {
+               if (isPostRequestElementSet($entry)) {
                        // Then convert it
                        convertCommaToDotInPostData($entry);
                } // END - if