From: Bart Visscher Date: Tue, 26 Jun 2012 20:24:16 +0000 (+0200) Subject: Check if app is enabled before loading in remote and public.php X-Git-Tag: v4.5.0beta1~74^2~49^2~151 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=153ee9dcfa62fa7efaf365890884c516d8bc11a1;p=nextcloud-server.git Check if app is enabled before loading in remote and public.php --- diff --git a/public.php b/public.php index 19c02a7a027..8846769f467 100644 --- a/public.php +++ b/public.php @@ -10,6 +10,7 @@ if(is_null($file)){ $parts=explode('/',$file,2); $app=$parts[0]; +OC_Util::checkAppEnabled($app); OC_App::loadApp($app); require_once(OC_App::getAppPath($app) .'/'. $parts[1]); diff --git a/remote.php b/remote.php index e68a53800c7..af48cd922c8 100644 --- a/remote.php +++ b/remote.php @@ -27,13 +27,24 @@ $file = ltrim ($file, '/'); if(count(explode('/',$file)) == 2) { $parts=explode('/',$file); - $app=$parts[1]; - OC_App::loadApp($app); + $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]);