/**
* 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.3 [CVS-DEVEL]';
+$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
/*
* 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://';
$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) {