I have rolled back Stefan's additions.
[squirrelmail.git] / functions / strings.php
index ab87da52eb2ce75264d74e0ba0cc30d4d3d48d3b..b4d1a5406549c10609cc94438d52502f8db26a61 100644 (file)
@@ -3,7 +3,7 @@
 /** 
  * strings.php
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * This code provides various string manipulation functions that are
  * SquirrelMail version number -- DO NOT CHANGE
  */
 global $version;
-$version = '1.3.2';
+$version = '1.4.0 [CVS-DEVEL]';
+
+/** 
+ * SquirrelMail internal version number -- DO NOT CHANGE
+ * $sm_internal_version = array (release, major, minor)
+ */
+global $SQM_INTERNAL_VERSION;
+$SQM_INTERNAL_VERSION = array(1,4,0);
+
 
 /**
  * Wraps text at $wrap characters
@@ -194,12 +202,13 @@ function get_location () {
     
     /*
      * If you have 'SSLOptions +StdEnvVars' in your apache config
-     *     OR if you have HTTPS in your HTTP_SERVER_VARS
+     *     OR if you have HTTPS=on in your HTTP_SERVER_VARS
      *     OR if you are on port 443
      */
     $getEnvVar = getenv('HTTPS');
     if ((isset($getEnvVar) && !strcasecmp($getEnvVar, 'on')) ||
-        (isset($_SERVER['HTTPS'])) ||
+        (isset($_SERVER['HTTPS']) &&
+         !strcasecmp($_SERVER['HTTPS'], 'on')) ||
         (isset($_SERVER['SERVER_PORT']) &&
          $_SERVER['SERVER_PORT'] == 443)) {
         $proto = 'https://';
@@ -275,24 +284,7 @@ function sq_mt_seed($Val) {
     $Max = mt_getrandmax();
     
     if (! is_int($Val)) {
-        if (function_exists('crc32')) {
             $Val = crc32($Val);
-        } else {
-            $Str = $Val;
-            $Pos = 0;
-            $Val = 0;
-            $Mask = $Max / 2;
-            $HighBit = $Max ^ $Mask;
-            while ($Pos < strlen($Str)) {
-                if ($Val & $HighBit) {
-                    $Val = (($Val & $Mask) << 1) + 1;
-                } else {
-                    $Val = ($Val & $Mask) << 1;
-                }
-                $Val ^= $Str[$Pos];
-                $Pos ++;
-            }
-        }
     }
     
     if ($Val < 0) {