~ubuntu-branches/ubuntu/maverick/ilohamail/maverick

« back to all changes in this revision

Viewing changes to IlohaMail/include/super2global.inc

  • Committer: Bazaar Package Importer
  • Author(s): Joerg Jaspert
  • Date: 2004-02-04 13:44:37 UTC
  • Revision ID: james.westby@ubuntu.com-20040204134437-kz8j3ui2qa7oq8z2
Tags: upstream-0.8.12
ImportĀ upstreamĀ versionĀ 0.8.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/********************************************************
 
3
        include/super2global.inc
 
4
        
 
5
        (C)Ryo Chijiiwa <Ryo@IlohaMail.org> 2002 
 
6
 
 
7
        This file is part of IlohaMail, and released under GPL.
 
8
        See COPYING, or http://www.fsf.org/copyleft/gpl.html
 
9
        
 
10
        PURPOSE:
 
11
                Convert super globals (in PHP > 4.1) to globals.
 
12
 
 
13
********************************************************/
 
14
 
 
15
error_reporting(E_ERROR | E_WARNING | E_PARSE);
 
16
 
 
17
function input_filter($str){
 
18
        if (ini_get('magic_quotes_gpc')!=1 && is_string($str))  $str = addslashes($str);
 
19
        return $str;
 
20
}
 
21
 
 
22
if (isset($_GET)){
 
23
        while ( list($var, $val) = each($_GET) ) $$var = input_filter($val);
 
24
}
 
25
 
 
26
if (isset($_POST)){
 
27
        while ( list($var, $val) = each($_POST) ) $$var = input_filter($val);
 
28
}
 
29
 
 
30
if (isset($_FILES)){
 
31
        while ( list($n, $val) = each($_FILES) ){
 
32
                $$n = $_FILES[$n]['tmp_name'];
 
33
                $var = $n."_name";
 
34
                $$var = $_FILES[$n]['name'];
 
35
                $var = $n."_size";
 
36
                $$var = $_FILES[$n]['size'];
 
37
                $var = $n."_type";
 
38
                $$var = $_FILES[$n]['type'];
 
39
        }
 
40
}
 
41
 
 
42
if (!empty($_COOKIE["ILOHAMAIL_SESSION"])){
 
43
        $ILOHAMAIL_SESSION = input_filter($_COOKIE["ILOHAMAIL_SESSION"]);
 
44
        $user = $ILOHAMAIL_SESSION;
 
45
        $session = $user;
 
46
}
 
47
 
 
48
include_once("../include/langs.inc");
 
49
 
 
50
//sanitize int_lang...just in case
 
51
if (isset($int_lang)){
 
52
        if (empty($languages[$int_lang])) $int_lang = "";
 
53
}
 
54
 
 
55
// validate $lang, set to default
 
56
// auth_session should set it to $my_prefs["lang"]
 
57
if (empty($languages[$lang])){
 
58
        if ((!empty($int_lang)) && ($languages[$int_lang])) $lang = $int_lang;
 
59
        else $lang = "eng/";
 
60
}
 
61
?>
 
 
b'\\ No newline at end of file'