plugins/kolab_files

Aleksander Machniak machniak at kolabsys.com
Fri Aug 2 13:25:29 CEST 2013


 plugins/kolab_files/lib/kolab_files_engine.php |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 963261269fec63f071b7330e27bc444548d0f8ff
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Fri Aug 2 13:25:03 2013 +0200

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

diff --git a/plugins/kolab_files/lib/kolab_files_engine.php b/plugins/kolab_files/lib/kolab_files_engine.php
index cba5b4a..07a7de7 100644
--- a/plugins/kolab_files/lib/kolab_files_engine.php
+++ b/plugins/kolab_files/lib/kolab_files_engine.php
@@ -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();




More information about the commits mailing list