~ubuntu-branches/ubuntu/hardy/squirrelmail/hardy-updates

« back to all changes in this revision

Viewing changes to functions/decode/us_ascii.php

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2005-02-06 21:41:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050206214151-z4n1o8mnttgzuj0y
Tags: 2:1.4.4-3
* Move default_pref config file from /var to /etc, as per Debian policy
  (Closes: #293281)
* [JvW] (finally) override two lintian warnings about nonstandard
  permissions that are intentional (Closes: #293366)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/**
4
4
 * functions/decode/us_ascii.php
5
5
 *
6
 
 * Copyright (c) 2004 The SquirrelMail Project Team
 
6
 * Copyright (c) 2004-2005 The SquirrelMail Project Team
7
7
 * Licensed under the GNU GPL. For full terms see the file COPYING.
8
8
 *
9
9
 * This file contains us-ascii decoding function that is needed to read
11
11
 *
12
12
 * Function replaces all 8bit symbols with '?' marks
13
13
 *
14
 
 * $Id: us_ascii.php,v 1.1 2004/01/29 19:37:29 tokul Exp $
 
14
 * @version $Id: us_ascii.php,v 1.2.2.4 2004/12/27 15:03:47 kink Exp $
15
15
 * @package squirrelmail
16
16
 * @subpackage decode
17
17
 */
23
23
 * @return string cleaned string
24
24
 */
25
25
function charset_decode_us_ascii ($string) {
26
 
    global $default_charset;
27
 
 
28
 
    if (strtolower($default_charset) == 'us-ascii')
29
 
        return $string;
30
 
 
31
 
    if (! ereg("[\200-\237]", $string) and ! ereg("[\241-\377]", $string) )
 
26
    // don't do decoding when there are no 8bit symbols
 
27
    if (! sq_is8bit($string,'us-ascii'))
32
28
        return $string;
33
29
 
34
30
    $string = preg_replace("/([\201-\237])/e","'?'",$string);