Changeset 159 in subversion for trunk/roundcubemail/program/include/main.inc
- Timestamp:
- Mar 3, 2006 11:34:35 AM (7 years ago)
- File:
-
- 1 edited
-
trunk/roundcubemail/program/include/main.inc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/main.inc
r156 r159 25 25 26 26 27 // define constannts for input reading 28 define('RCUBE_INPUT_GET', 0x0101); 29 define('RCUBE_INPUT_POST', 0x0102); 30 define('RCUBE_INPUT_GPC', 0x0103); 31 32 27 33 // register session and connect to server 28 34 function rcmail_startup($task='mail') … … 377 383 $imap_port = isset($a_host['port']) ? $a_host['port'] : ($imap_ssl ? 993 : $CONFIG['default_port']); 378 384 } 385 else 386 $imap_port = $CONFIG['default_port']; 379 387 380 388 // query if user already registered … … 896 904 return $str; 897 905 } 906 907 908 /** 909 * Read input value and convert it for internal use 910 * Performs stripslashes() and charset conversion if necessary 911 * 912 * @param string Field name to read 913 * @param int Source to get value from (GPC) 914 * @param boolean Allow HTML tags in field value 915 * @param string Charset to convert into 916 * @return string Field value or NULL if not available 917 */ 918 function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL) 919 { 920 global $OUTPUT; 921 $value = NULL; 922 923 if ($source==RCUBE_INPUT_GET && isset($_GET[$fname])) 924 $value = $_GET[$fname]; 925 else if ($source==RCUBE_INPUT_POST && isset($_POST[$fname])) 926 $value = $_POST[$fname]; 927 else if ($source==RCUBE_INPUT_GPC) 928 { 929 if (isset($_GET[$fname])) 930 $value = $_GET[$fname]; 931 else if (isset($_POST[$fname])) 932 $value = $_POST[$fname]; 933 else if (isset($_COOKIE[$fname])) 934 $value = $_COOKIE[$fname]; 935 } 936 937 // strip slashes if magic_quotes enabled 938 if ((bool)get_magic_quotes_gpc()) 939 $value = stripslashes($value); 940 941 // remove HTML tags if not allowed 942 if (!$allow_html) 943 $value = strip_tags($value); 944 945 // convert to internal charset 946 return rcube_charset_convert($value, $OUTPUT->get_charset(), $charset); 947 } 948 898 949 899 950 … … 1483 1534 1484 1535 $fields = array(); 1485 $fields['user'] = $input_user->show( $_POST['_user']);1536 $fields['user'] = $input_user->show(get_input_value('_user', RCUBE_INPUT_POST)); 1486 1537 $fields['pass'] = $input_pass->show(); 1487 1538 $fields['action'] = $input_action->show();
Note: See TracChangeset
for help on using the changeset viewer.
