Check if the app is enabled and the app path is found before trying to load the script file
This commit is contained in:
parent
6127fee5aa
commit
57370353ad
|
@ -661,12 +661,15 @@ class OC {
|
||||||
$app = $param['app'];
|
$app = $param['app'];
|
||||||
$file = $param['file'];
|
$file = $param['file'];
|
||||||
$app_path = OC_App::getAppPath($app);
|
$app_path = OC_App::getAppPath($app);
|
||||||
|
if (OC_App::isEnabled($app) && $app_path !== false) {
|
||||||
$file = $app_path . '/' . $file;
|
$file = $app_path . '/' . $file;
|
||||||
unset($app, $app_path);
|
unset($app, $app_path);
|
||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
require_once $file;
|
require_once $file;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
header('HTTP/1.0 404 Not Found');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue