Simplified remote.php file loading
This commit is contained in:
parent
e258da5c3c
commit
9ea34cae43
36
remote.php
36
remote.php
|
@ -25,27 +25,17 @@ if(is_null($file)){
|
||||||
|
|
||||||
$file = ltrim ($file, '/');
|
$file = ltrim ($file, '/');
|
||||||
|
|
||||||
if(count(explode('/',$file)) == 2) {
|
$parts=explode('/', $file, 2);
|
||||||
$parts=explode('/',$file);
|
$app=$parts[0];
|
||||||
$app=$parts[0];
|
switch ($app) {
|
||||||
switch ($app) {
|
default:
|
||||||
case 'files':
|
OC_Util::checkAppEnabled($app);
|
||||||
OC_Util::checkAppEnabled($app);
|
OC_App::loadApp($app);
|
||||||
OC_App::loadApp($app);
|
$file = OC_App::getAppPath($app) .'/'. $parts[1];
|
||||||
break;
|
break;
|
||||||
case 'core':
|
case 'core':
|
||||||
break;
|
$file = OC::$SERVERROOT .'/'. $file;
|
||||||
default:
|
break;
|
||||||
OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
$baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
|
|
||||||
require_once( OC::$SERVERROOT.'/'.$file);
|
|
||||||
} else {
|
|
||||||
$parts=explode('/', $file, 2);
|
|
||||||
$app=$parts[0];
|
|
||||||
OC_Util::checkAppEnabled($app);
|
|
||||||
OC_App::loadApp($app);
|
|
||||||
$baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
|
|
||||||
require_once(OC_App::getAppPath($app) .'/'. $parts[1]);
|
|
||||||
}
|
}
|
||||||
|
$baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
|
||||||
|
require_once($file);
|
||||||
|
|
Loading…
Reference in New Issue