aboutsummaryrefslogtreecommitdiffstats
path: root/remote.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-06-29 22:12:39 +0200
committerBart Visscher <bartv@thisnet.nl>2012-07-04 17:51:07 +0200
commit9ea34cae43c20206e02ff12040ab558b4ba64d80 (patch)
treea2ce9e09106e42ea127d7a90998dc115359d3d63 /remote.php
parente258da5c3c81a256c21e7423085089a7bd6a898d (diff)
downloadnextcloud-server-9ea34cae43c20206e02ff12040ab558b4ba64d80.tar.gz
nextcloud-server-9ea34cae43c20206e02ff12040ab558b4ba64d80.zip
Simplified remote.php file loading
Diffstat (limited to 'remote.php')
-rw-r--r--remote.php36
1 files changed, 13 insertions, 23 deletions
diff --git a/remote.php b/remote.php
index af48cd922c8..bdce867aaba 100644
--- a/remote.php
+++ b/remote.php
@@ -25,27 +25,17 @@ if(is_null($file)){
$file = ltrim ($file, '/');
-if(count(explode('/',$file)) == 2) {
- $parts=explode('/',$file);
- $app=$parts[0];
- switch ($app) {
- case 'files':
- OC_Util::checkAppEnabled($app);
- OC_App::loadApp($app);
- break;
- case 'core':
- break;
- default:
- 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]);
+$parts=explode('/', $file, 2);
+$app=$parts[0];
+switch ($app) {
+ default:
+ OC_Util::checkAppEnabled($app);
+ OC_App::loadApp($app);
+ $file = OC_App::getAppPath($app) .'/'. $parts[1];
+ break;
+ case 'core':
+ $file = OC::$SERVERROOT .'/'. $file;
+ break;
}
+$baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
+require_once($file);