diff options
author | thomascube <thomas@roundcube.net> | 2008-09-12 14:01:52 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2008-09-12 14:01:52 +0000 |
commit | cf17773654e1e3f2b09a8aee1058bda4ada3bed1 (patch) | |
tree | 08c0a4b63dd55c12b782d2f37ead64ce692fc21f /program | |
parent | 118f40b5d5f0791ab79669977c77714f3f54b80c (diff) |
Fix rcmail::url(), don't use comm_path
Diffstat (limited to 'program')
-rw-r--r-- | program/include/rcmail.php | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php index c10f83559..e7a0db826 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -891,17 +891,19 @@ class rcmail { if (!is_array($p)) $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) - if (isset($val)) - $url .= '&'.urlencode($par).'='.urlencode($val); - + + if (!$p['task'] || !in_array($p['task'], rcmail::$main_tasks)) + $p['task'] = $this->task; + + $url = './'; + $delm = '?'; + foreach (array_reverse($p) as $par => $val) + { + if (!empty($val)) { + $url .= $delm.urlencode($par).'='.urlencode($val); + $delm = '&'; + } + } return $url; } } |