diff options
Diffstat (limited to 'inc/Remote/Api.php')
-rw-r--r-- | inc/Remote/Api.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/inc/Remote/Api.php b/inc/Remote/Api.php index 3b526564d..749c2e6ea 100644 --- a/inc/Remote/Api.php +++ b/inc/Remote/Api.php @@ -92,7 +92,8 @@ class Api if ($args === null) { $args = array(); } - list($type, $pluginName, /* $call */) = explode('.', $method, 3); + // Ensure we have at least one '.' in $method + list($type, $pluginName, /* $call */) = explode('.', $method . '.', 3); if ($type === 'plugin') { return $this->callPlugin($pluginName, $method, $args); } @@ -128,8 +129,9 @@ class Api if (!array_key_exists($method, $customCalls)) { throw new RemoteException('Method does not exist', -32603); } - $customCall = $customCalls[$method]; - return $this->callPlugin($customCall[0], $customCall[1], $args); + list($plugin, $method) = $customCalls[$method]; + $fullMethod = "plugin.$plugin.$method"; + return $this->callPlugin($plugin, $fullMethod, $args); } /** |