5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
11 if (defined ('validate_php'))
13 define ('validate_php', true);
16 include ('../functions/i18n.php');
17 include ('../functions/auth.php');
22 // Remove all slashes for form values
23 if (get_magic_quotes_gpc())
25 global $REQUEST_METHOD;
26 if ($REQUEST_METHOD == "POST")
28 global $HTTP_POST_VARS;
29 RemoveSlashes($HTTP_POST_VARS);
31 elseif ($REQUEST_METHOD == "GET")
33 global $HTTP_GET_VARS;
34 RemoveSlashes($HTTP_GET_VARS);
40 // if $send (the form button's name) contains "\n" as the first char
41 // and the script is compose.php, then trim everything. Otherwise,
42 // we don't have to worry.
44 // This is for a RedHat package bug and a Konqueror (pre 2.1.1?) bug
45 global $send, $PHP_SELF;
46 if (isset($send) && substr($send, 0, 1) == "\n" &&
47 substr($PHP_SELF, -12) == '/compose.php')
49 if ($REQUEST_METHOD == "POST") {
50 global $HTTP_POST_VARS;
51 TrimArray($HTTP_POST_VARS);
53 global $HTTP_GET_VARS;
54 TrimArray($HTTP_GET_VARS);
58 //**************************************************************************
59 // Trims every element in the array
60 //**************************************************************************
61 function TrimArray(&$array) {
62 foreach ($array as $k => $v) {
65 foreach ($
$k as $k2 => $v2) {
66 $
$k[$k2] = substr($v2, 1);
71 // Re-assign back to array
77 //**************************************************************************
78 // Removes slashes from every element in the array
79 //**************************************************************************
80 function RemoveSlashes(&$array)
82 foreach ($array as $k => $v)
87 foreach ($
$k as $k2 => $v2)
89 $newArray[stripslashes($k2)] = stripslashes($v2);
95 $
$k = stripslashes($v);
97 // Re-assign back to the array
102 // Everyone needs stuff from config, and config needs stuff from
103 // strings.php, so include them both here.
104 // Include them down here instead of at the top so that all config
105 // variables overwrite any passed in variables (for security)
106 include ('../functions/strings.php');
107 include ('../config/config.php');
108 include ('../src/load_prefs.php');
109 include ('../functions/page_header.php');
111 // Set up the language
112 // i18n.php was included by auth.php
113 global $username, $data_dir;
114 set_up_language(getPref($data_dir, $username, 'language'));