FIx so file href attribute is always an absolute URL (Bug #2063)

This commit is contained in:
Aleksander Machniak 2013-08-02 13:25:03 +02:00
parent f68bf6675d
commit 963261269f

View file

@ -448,6 +448,12 @@ class kolab_files_engine
}
if ($href = $this->file_data['viewer']['href']) {
// file href attribute must be an absolute URL (Bug #2063)
if (!empty($href)) {
if (!preg_match('|^https?://|', $href)) {
$href = $this->url . '/api/' . $href;
}
}
}
else {
$token = $this->get_api_token();