summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-03-11 12:43:39 +0100
committerJoas Schilling <coding@schilljs.com>2019-03-11 12:43:39 +0100
commita3c9e5b11b59b2fc3bb15f181c8c3ef74503d5bc (patch)
tree32850b620e8a4a5205d8edf2c0ab210ef67239e3 /lib
parent4e8b033281a1ecb4bd1fd8651cd91630022e9d38 (diff)
downloadnextcloud-server-a3c9e5b11b59b2fc3bb15f181c8c3ef74503d5bc.tar.gz
nextcloud-server-a3c9e5b11b59b2fc3bb15f181c8c3ef74503d5bc.zip
Add a message about disabled global routes
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppFramework/App.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/AppFramework/App.php b/lib/private/AppFramework/App.php
index abb779ca979..5a9fb0c64fc 100644
--- a/lib/private/AppFramework/App.php
+++ b/lib/private/AppFramework/App.php
@@ -31,6 +31,7 @@ namespace OC\AppFramework;
use OC\AppFramework\Http\Dispatcher;
use OC\AppFramework\DependencyInjection\DIContainer;
+use OC\HintException;
use OCP\AppFramework\Http;
use OCP\AppFramework\QueryException;
use OCP\AppFramework\Http\ICallbackResponse;
@@ -81,6 +82,7 @@ class App {
* @param string $methodName the method that you want to call
* @param DIContainer $container an instance of a pimple container.
* @param array $urlParams list of URL parameters (optional)
+ * @throws HintException
*/
public static function main(string $controllerName, string $methodName, DIContainer $container, array $urlParams = null) {
if (!is_null($urlParams)) {
@@ -94,6 +96,12 @@ class App {
try {
$controller = $container->query($controllerName);
} catch(QueryException $e) {
+ if (strpos($controllerName, '\\Controller\\') !== false) {
+ // This is from a global registered app route that is not enabled.
+ [/*OC(A)*/, $app, /* Controller/Name*/] = explode('\\', $controllerName, 3);
+ throw new HintException('App ' . strtolower($app) . ' is not enabled');
+ }
+
if ($appName === 'core') {
$appNameSpace = 'OC\\Core';
} else if ($appName === 'settings') {