diff options
author | Aleksander Machniak <machniak@kolabsys.com> | 2014-08-24 09:43:42 (GMT) |
---|---|---|
committer | Aleksander Machniak <machniak@kolabsys.com> | 2014-08-24 09:43:42 (GMT) |
commit | c15bec9ae60eb60f2e11c5cfc79b7bf1de66e5eb (patch) | |
tree | ce46f21d03d10acfd0ec8516b0e39e8afd344ad6 /plugins/kolab_files | |
parent | 9a39d37c6930eb0e2bf0bb357f7bfe13ba2730d1 (diff) | |
download | roundcubemail-plugins-kolab-c15bec9ae60eb60f2e11c5cfc79b7bf1de66e5eb.tar.gz |
Use rcube_utils::resolve_url() (Note: this requires current Roundcube git-master)
Diffstat (limited to 'plugins/kolab_files')
-rw-r--r-- | plugins/kolab_files/lib/kolab_files_engine.php | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/plugins/kolab_files/lib/kolab_files_engine.php b/plugins/kolab_files/lib/kolab_files_engine.php index 6e81e1a..8cb408b 100644 --- a/plugins/kolab_files/lib/kolab_files_engine.php +++ b/plugins/kolab_files/lib/kolab_files_engine.php @@ -34,7 +34,7 @@ class kolab_files_engine */ public function __construct($plugin, $url) { - $this->url = $this->resolve_url($url); + $this->url = rcube_utils::resolve_url($url); $this->plugin = $plugin; $this->rc = $plugin->rc; } @@ -1017,30 +1017,4 @@ class kolab_files_engine return $mimetypes; } - - /** - * Resolve relative URL - */ - protected function resolve_url($url) - { - // prepend protocol://hostname:port - if (!preg_match('|^https?://|', $url)) { - $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']; - } - - $url = $prefix . ($url[0] == '/' ? '' : '/') . $url; - } - - return $url; - } } |