]> source.dussan.org Git - nextcloud-server.git/commitdiff
Trim url and path of appsroot to have and standart type of path fix oc-1107
authorBrice Maron <brice@bmaron.net>
Mon, 25 Jun 2012 13:50:27 +0000 (15:50 +0200)
committerBrice Maron <brice@bmaron.net>
Mon, 25 Jun 2012 13:50:27 +0000 (15:50 +0200)
lib/base.php

index 870550f267d2f1c56352a0831694c1a53fab02c6..b4da6434e2531c29e6d18138c9548a41d8b13580 100644 (file)
@@ -136,14 +136,16 @@ class OC{
                $config_paths = OC_Config::getValue('apps_paths', array());
                if(! empty($config_paths)){
                        foreach($config_paths as $paths) {
-                               if( isset($paths['url']) && isset($paths['path']))
-                                       OC::$APPSROOTS[] = $paths;      
+                               if( isset($paths['url']) && isset($paths['path'])) {
+                                       $paths['url'] = rtrim($paths['url'],'/');
+                                       $paths['path'] = rtrim($paths['path'],'/');
+                                       OC::$APPSROOTS[] = $paths;
+                               }
                        }
                }elseif(file_exists(OC::$SERVERROOT.'/apps')){
-                       OC::$APPSROOTS[] = array('path'=> OC::$SERVERROOT.'/apps', 'url' => '/apps/', 'writable' => true);
+                       OC::$APPSROOTS[] = array('path'=> OC::$SERVERROOT.'/apps', 'url' => '/apps', 'writable' => true);
                }elseif(file_exists(OC::$SERVERROOT.'/../apps')){
-                       OC::$APPSROOTS[] = array('path'=> rtrim(dirname(OC::$SERVERROOT), '/').'/apps', 'url' => '/apps/', 'writable' => true);
-                       OC::$APPSROOT=rtrim(dirname(OC::$SERVERROOT), '/');
+                       OC::$APPSROOTS[] = array('path'=> rtrim(dirname(OC::$SERVERROOT), '/').'/apps', 'url' => '/apps', 'writable' => true);
                }
 
                if(empty(OC::$APPSROOTS)){