~ubuntu-branches/ubuntu/karmic/squirrelmail/karmic

« back to all changes in this revision

Viewing changes to functions/strings.php

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2006-07-04 14:49:23 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060704144923-w5l1xdbivclpkmda
Tags: 2:1.4.7-1
* New upstream bugfix release.
  + Addresses some low-impact, theoretical or disputed security bugs,
    for which the code is tightened just-in-case:
    - Possible local file inclusion (Closes: #373731, CVE-2006-2842)
    - XSS in search.php (Closes: #375782, CVE-2006-3174)
  + Adds note to db-backend.txt about postgreSQL (Closes: #376605).

* Checked for standards version to 3.7.2, no changes necessary.
* Update maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/**
4
4
 * strings.php
5
5
 *
6
 
 * Copyright (c) 1999-2006 The SquirrelMail Project Team
7
 
 * Licensed under the GNU GPL. For full terms see the file COPYING.
8
 
 *
9
6
 * This code provides various string manipulation functions that are
10
 
 * used by the rest of the Squirrelmail code.
 
7
 * used by the rest of the SquirrelMail code.
11
8
 *
12
 
 * @version $Id: strings.php,v 1.184.2.46 2006/02/23 21:17:44 kink Exp $
 
9
 * @copyright © 1999-2006 The SquirrelMail Project Team
 
10
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 
11
 * @version $Id: strings.php,v 1.184.2.53 2006/07/04 18:48:56 jangliss Exp $
13
12
 * @package squirrelmail
14
13
 */
15
14
 
17
16
 * SquirrelMail version number -- DO NOT CHANGE
18
17
 */
19
18
global $version;
20
 
$version = '1.4.6';
 
19
$version = '1.4.7';
21
20
 
22
21
/**
23
22
 * SquirrelMail internal version number -- DO NOT CHANGE
24
23
 * $sm_internal_version = array (release, major, minor)
25
24
 */
26
25
global $SQM_INTERNAL_VERSION;
27
 
$SQM_INTERNAL_VERSION = array(1,4,6);
 
26
$SQM_INTERNAL_VERSION = array(1,4,7);
28
27
 
29
28
/**
30
29
 * There can be a circular issue with includes, where the $version string is
245
244
    /**
246
245
     * If it is in the session, just return it.
247
246
     */
248
 
    if (isset($base_uri)){
 
247
    if (sqgetGlobalVar('base_uri',$base_uri,SQ_SESSION)){
249
248
        return $base_uri;
250
249
    }
251
250
    $dirs = array('|src/.*|', '|plugins/.*|', '|functions/.*|');
291
290
     *     OR if you are on port 443
292
291
     */
293
292
    $getEnvVar = getenv('HTTPS');
294
 
    if ((isset($getEnvVar) && !strcasecmp($getEnvVar, 'on')) ||
295
 
        (sqgetGlobalVar('HTTPS', $https_on, SQ_SERVER) && !strcasecmp($https_on, 'on')) ||
 
293
    if ((isset($getEnvVar) && strcasecmp($getEnvVar, 'on') === 0) ||
 
294
        (sqgetGlobalVar('HTTPS', $https_on, SQ_SERVER) && strcasecmp($https_on, 'on') === 0) ||
296
295
        (sqgetGlobalVar('SERVER_PORT', $server_port, SQ_SERVER) &&  $server_port == 443)) {
297
296
        $proto = 'https://';
298
297
    }
299
298
 
300
299
    /* Get the hostname from the Host header or server config. */
301
 
    if ( !sqgetGlobalVar('HTTP_HOST', $host, SQ_SERVER) || empty($host) ) {
302
 
      if ( !sqgetGlobalVar('SERVER_NAME', $host, SQ_SERVER) || empty($host) ) {
303
 
        $host = '';
304
 
      }
 
300
    if ( !sqgetGlobalVar('HTTP_X_FORWARDED_HOST', $host, SQ_SERVER) || empty($host) ) {
 
301
        if ( !sqgetGlobalVar('HTTP_HOST', $host, SQ_SERVER) || empty($host) ) {
 
302
            if ( !sqgetGlobalVar('SERVER_NAME', $host, SQ_SERVER) || empty($host) ) {
 
303
                $host = '';
 
304
            }
 
305
        }
305
306
    }
306
307
 
307
308
    $port = '';
846
847
    $val = strtolower($val);
847
848
}
848
849
 
 
850
/**
 
851
 * Callback function to trim whitespace from a value, to be used in array_walk
 
852
 * @param string $value value to trim
 
853
 * @since 1.5.2 and 1.4.7
 
854
 */
 
855
function sq_trim_value ( &$value ) {
 
856
    $value = trim($value);
 
857
}
 
858
 
 
859
 
849
860
$PHP_SELF = php_self();
850
861
?>