]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix remote share when remote server is installed at the root
authorRobin Appelman <icewind@owncloud.com>
Wed, 23 Jul 2014 11:45:56 +0000 (13:45 +0200)
committerRobin Appelman <icewind@owncloud.com>
Wed, 23 Jul 2014 11:45:56 +0000 (13:45 +0200)
apps/files_sharing/lib/external/storage.php

index 3a0de51192e63b82f04434b06be4f7278b15a09a..855be2872b503d6c50576dccdb538f69ba40340e 100644 (file)
@@ -49,7 +49,12 @@ class Storage extends DAV implements ISharedStorage {
                $this->remote = $options['remote'];
                $this->remoteUser = $options['owner'];
                list($protocol, $remote) = explode('://', $this->remote);
-               list($host, $root) = explode('/', $remote, 2);
+               if (strpos($remote, '/')) {
+                       list($host, $root) = explode('/', $remote, 2);
+               } else {
+                       $host = $remote;
+                       $root = '';
+               }
                $secure = $protocol === 'https';
                $root = rtrim($root, '/') . '/public.php/webdav';
                $this->mountPoint = $options['mountpoint'];
@@ -148,7 +153,7 @@ class Storage extends DAV implements ISharedStorage {
                                        // ownCloud instance is gone, likely to be a temporary server configuration error
                                        throw $e;
                                }
-                       } catch(\Exception $shareException) {
+                       } catch (\Exception $shareException) {
                                // todo, maybe handle 403 better and ask the user for a new password
                                throw $e;
                        }