Code style changed, ext-user continued:
[mailer.git] / inc / libs / security_functions.php
index 8409e0c72742e092d8c91239b9052f21d21fa538..67aea962195e7b8057a4b67031b6ceaf57afb906 100644 (file)
@@ -41,7 +41,7 @@ if (defined('__SECURITY')) {
 } // END - if
 
 // Some security stuff...
-if (strpos($_SERVER['PHP_SELF'], basename(__FILE__)) !== false) {
+if (strpos($_SERVER['PHP_SELF'], basename(__FILE__)) !== FALSE) {
        die();
 } // END - if
 
@@ -56,9 +56,9 @@ if (strpos($_SERVER['PHP_SELF'], basename(__FILE__)) !== false) {
  * @param      $stripTags      Strip tags
  * @return     $str            A (hopefully) secured string against XSS and other bad things
  */
-function secureString ($str, $stripTags = true, $encode = false) {
+function secureString ($str, $stripTags = TRUE, $encode = FALSE) {
        // Shall we strip HTML code?
-       if ($stripTags === true) {
+       if ($stripTags === TRUE) {
                $str = strip_tags($str);
        } // END - if
 
@@ -66,7 +66,7 @@ function secureString ($str, $stripTags = true, $encode = false) {
        $str = trim($str);
 
        // Encode in entities if requested
-       if ($encode === true) {
+       if ($encode === TRUE) {
                // Encode in entities (this breakes UTF-8!)
                $str = htmlentities($str, ENT_QUOTES);
        } // END - if
@@ -98,7 +98,7 @@ function securePhpSelf () {
        $phpSelfFile      = basename($_SERVER['PHP_SELF']);
 
        // Check for a .php inside the $phpSelfDirectory...
-       while (strpos($phpSelfDirectory, '.php') !== false) {
+       while (strpos($phpSelfDirectory, '.php') !== FALSE) {
                // Correct the dirname
                $phpSelfDirectory = substr($phpSelfDirectory, 0, (strpos($phpSelfDirectory, '.php') + 4));
                // Rewrite filename...
@@ -111,7 +111,7 @@ function securePhpSelf () {
        $_SERVER['PHP_SELF'] = $phpSelfDirectory . '/' . $phpSelfFile;
 
        // Did run...
-       $GLOBALS['php_self_secured'] = true;
+       $GLOBALS['php_self_secured'] = TRUE;
 
        // Remove uneccessary variables
        unset($phpSelfDirectory);
@@ -151,8 +151,8 @@ function detectPhpCaching () {
 }
 
 // Runtime/GPC quoting is off now...
-ini_set('magic_quotes_runtime', false);
-ini_set('magic_quotes_gpc', false); // This may not work on some systems
+ini_set('magic_quotes_runtime', FALSE);
+ini_set('magic_quotes_gpc', FALSE); // This may not work on some systems
 
 /*
  * No compatibility with Zend Engine 1, else an error like 'Implicit cloning'