summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-08-24 11:43:12 +0200
committerAleksander Machniak <alec@alec.pl>2014-08-24 11:43:12 +0200
commit5f58127eae9ed8c54c190506e11af13e8ba57170 (patch)
tree1cffa050bf982c6e346acd96194e47f4374544a8 /program/include
parent75bbada03b0e616248ec3458d1a6ee98bfc03659 (diff)
Added rcube_utils::resolve_url()
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcmail.php21
1 files changed, 6 insertions, 15 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 52b53e9d9..ece0606ae 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -827,26 +827,17 @@ class rcmail extends rcube
}
if ($absolute || $full) {
- $prefix = '';
+ // add base path to this Roundcube installation
+ $base_path = preg_replace('![^/]+$!', '', strval($_SERVER['SCRIPT_NAME']));
+ if ($base_path == '') $base_path = '/';
+ $prefix = $base_path;
// prepend protocol://hostname:port
if ($full) {
- $schema = 'http';
- $default_port = 80;
- if (rcube_utils::https_check()) {
- $schema = 'https';
- $default_port = 443;
- }
- $prefix = $schema . '://' . preg_replace('/:\d+$/', '', $_SERVER['HTTP_HOST']);
- if ($_SERVER['SERVER_PORT'] != $default_port) {
- $prefix .= ':' . $_SERVER['SERVER_PORT'];
- }
+ $prefix = rcube_utils::resolve_url($prefix);
}
- // add base path to this Roundcube installation
- $base_path = preg_replace('![^/]+$!', '', strval($_SERVER['SCRIPT_NAME']));
- if ($base_path == '') $base_path = '/';
- $prefix .= $base_path;
+ $prefix = rtrim($prefix, '/') . '/';
}
else {
$prefix = './';