thomascube
2008-06-24 0d88e5095509ebf69ba748d5bb52460807c3880d
program/include/rcmail.php
@@ -474,7 +474,7 @@
  public function autoselect_host()
  {
    $default_host = $this->config->get('default_host');
    $host = !empty($default_host) ? get_input_value('_host', RCUBE_INPUT_POST) : $default_host;
    $host = empty($default_host) ? get_input_value('_host', RCUBE_INPUT_POST) : $default_host;
    
    if (is_array($host)) {
      list($user, $domain) = explode('@', get_input_value('_user', RCUBE_INPUT_POST));
@@ -830,13 +830,16 @@
  public function url($p)
  {
    if (!is_array($p))
      $p = array('action' => @func_get_arg(0));
    $url = $p['task'] ? './?_task=' . $p['task'] : $this->comm_path;
    unset($p['task']);
      $p = array('_action' => @func_get_arg(0));
    
    if ($p['task'] && in_array($p['task'], rcmail::$main_tasks))
      $url = './?_task='.$p['task'];
    else
      $url = $this->comm_path;
    unset($p['task']);
    foreach ($p as $par => $val)
      $url .= sprintf('&%s=%s', urlencode($par), urlencode($val));
      $url .= '&'.urlencode($par).'='.urlencode($val);
    
    return $url;
  }