]> source.dussan.org Git - nextcloud-server.git/commitdiff
Try to fix the remote pbm. fix oc-1090
authorBrice Maron <brice@bmaron.net>
Sun, 24 Jun 2012 08:06:42 +0000 (08:06 +0000)
committerBrice Maron <brice@bmaron.net>
Sun, 24 Jun 2012 08:06:42 +0000 (08:06 +0000)
remote.php

index ef610f369470e9302620c391f91e1f5241d8fcca..976012dea5ad3731a3fb5e10626ebb6886778ac0 100644 (file)
@@ -20,16 +20,19 @@ if(is_null($file)){
        OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND);
        exit;
 }
-if(count(explode('/',$file)) == 3) {
+
+$file = ltrim ($file, '/');
+
+if(count(explode('/',$file)) == 2) {
        $parts=explode('/',$file);
-       $app=$parts[2];
+       $app=$parts[1];
        OC_App::loadApp($app);
        $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
-       require_once( OC::$SERVERROOT.$file);
+       require_once( OC::$SERVERROOT.'/'.$file);
 } else {
-       $parts=explode('/', $file, 4);
-       $app=$parts[2];
+       $parts=explode('/', $file, 2);
+       $app=$parts[0];
        OC_App::loadApp($app);
        $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
-       require_once(OC_App::getAppPath($app) .'/'. $parts[3]);
+       require_once(OC_App::getAppPath($app) .'/'. $parts[1]);
 }