|
|
@ -641,12 +641,15 @@ function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$value = NULL;
|
|
|
|
$value = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
if ($source==RCUBE_INPUT_GET && isset($_GET[$fname]))
|
|
|
|
if ($source == RCUBE_INPUT_GET) {
|
|
|
|
|
|
|
|
if (isset($_GET[$fname]))
|
|
|
|
$value = $_GET[$fname];
|
|
|
|
$value = $_GET[$fname];
|
|
|
|
else if ($source==RCUBE_INPUT_POST && isset($_POST[$fname]))
|
|
|
|
}
|
|
|
|
|
|
|
|
else if ($source == RCUBE_INPUT_POST) {
|
|
|
|
|
|
|
|
if (isset($_POST[$fname]))
|
|
|
|
$value = $_POST[$fname];
|
|
|
|
$value = $_POST[$fname];
|
|
|
|
else if ($source==RCUBE_INPUT_GPC)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
else if ($source == RCUBE_INPUT_GPC) {
|
|
|
|
if (isset($_POST[$fname]))
|
|
|
|
if (isset($_POST[$fname]))
|
|
|
|
$value = $_POST[$fname];
|
|
|
|
$value = $_POST[$fname];
|
|
|
|
else if (isset($_GET[$fname]))
|
|
|
|
else if (isset($_GET[$fname]))
|
|
|
@ -691,10 +694,16 @@ function parse_input_value($value, $allow_html=FALSE, $charset=NULL)
|
|
|
|
if (!$allow_html)
|
|
|
|
if (!$allow_html)
|
|
|
|
$value = strip_tags($value);
|
|
|
|
$value = strip_tags($value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$output_charset = is_object($OUTPUT) ? $OUTPUT->get_charset() : null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// remove invalid characters (#1488124)
|
|
|
|
|
|
|
|
if ($output_charset == 'UTF-8')
|
|
|
|
|
|
|
|
$value = rc_utf8_clean($value);
|
|
|
|
|
|
|
|
|
|
|
|
// convert to internal charset
|
|
|
|
// convert to internal charset
|
|
|
|
if (is_object($OUTPUT) && $charset)
|
|
|
|
if ($charset && $output_charset)
|
|
|
|
return rcube_charset_convert($value, $OUTPUT->get_charset(), $charset);
|
|
|
|
$value = rcube_charset_convert($value, $output_charset, $charset);
|
|
|
|
else
|
|
|
|
|
|
|
|
return $value;
|
|
|
|
return $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -711,7 +720,7 @@ function request2param($mode = RCUBE_INPUT_GPC, $ignore = 'task|action')
|
|
|
|
$src = $mode == RCUBE_INPUT_GET ? $_GET : ($mode == RCUBE_INPUT_POST ? $_POST : $_REQUEST);
|
|
|
|
$src = $mode == RCUBE_INPUT_GET ? $_GET : ($mode == RCUBE_INPUT_POST ? $_POST : $_REQUEST);
|
|
|
|
foreach ($src as $key => $value) {
|
|
|
|
foreach ($src as $key => $value) {
|
|
|
|
$fname = $key[0] == '_' ? substr($key, 1) : $key;
|
|
|
|
$fname = $key[0] == '_' ? substr($key, 1) : $key;
|
|
|
|
if ($ignore && !preg_match("/($ignore)/", $fname))
|
|
|
|
if ($ignore && !preg_match('/^(' . $ignore . ')$/', $fname))
|
|
|
|
$out[$fname] = get_input_value($key, $mode);
|
|
|
|
$out[$fname] = get_input_value($key, $mode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|