e8542ce9ca4c50541a2cb32720b2444f9320ef8e
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/auth.php');
21 // Remove all slashes for form values
22 if (get_magic_quotes_gpc())
24 global $REQUEST_METHOD;
25 if ($REQUEST_METHOD == "POST")
27 global $HTTP_POST_VARS;
28 RemoveSlashes($HTTP_POST_VARS);
30 elseif ($REQUEST_METHOD == "GET")
32 global $HTTP_GET_VARS;
33 RemoveSlashes($HTTP_GET_VARS);
39 // if $send (the form button's name) contains "\n" as the first char
40 // and the script is compose.php, then trim everything. Otherwise,
41 // we don't have to worry.
43 // This is for a RedHat package bug and a Konqueror (pre 2.1.1?) bug
44 global $send, $PHP_SELF;
45 if (isset($send) && substr($send, 0, 1) == "\n" &&
46 substr($PHP_SELF, -12) == '/compose.php')
48 if ($REQUEST_METHOD == "POST") {
49 global $HTTP_POST_VARS;
50 TrimArray($HTTP_POST_VARS);
52 global $HTTP_GET_VARS;
53 TrimArray($HTTP_GET_VARS);
57 //**************************************************************************
58 // Trims every element in the array
59 //**************************************************************************
60 function TrimArray(&$array) {
61 foreach ($array as $k => $v) {
64 foreach ($
$k as $k2 => $v2) {
65 $
$k[$k2] = substr($v2, 1);
70 // Re-assign back to array
76 //**************************************************************************
77 // Removes slashes from every element in the array
78 //**************************************************************************
79 function RemoveSlashes(&$array)
81 foreach ($array as $k => $v)
86 foreach ($
$k as $k2 => $v2)
88 $newArray[stripslashes($k2)] = stripslashes($v2);
94 $
$k = stripslashes($v);
96 // Re-assign back to the array
101 // Everyone needs stuff from config, and config needs stuff from
102 // strings.php, so include them both here.
103 // Include them down here instead of at the top so that all config
104 // variables overwrite any passed in variables (for security)
105 include ('../functions/strings.php');
106 include ('../config/config.php');
107 include ('../src/load_prefs.php');
108 include ('../functions/page_header.php');
110 // Set up the language
111 // i18n.php was included by auth.php
112 global $username, $data_dir;
113 set_up_language(getPref($data_dir, $username, 'language'));