fix method handling for RPC_CALL_ADD

This event seems not to be used by any plugin, which explains why this
bug hasn't surfaced yet. Access is always checked against a full method
name in the form of plugin.<pluginname>.<method> Such a full method was
not passed when using an event as described in the documentation.
This commit is contained in:
Andreas Gohr 2021-02-16 23:21:48 +01:00
parent dfe72b68b7
commit f7acdb5eaf
1 changed files with 3 additions and 2 deletions

View File

@ -129,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);
}
/**