summaryrefslogtreecommitdiff
path: root/classes/handler/public.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-08-16 15:29:24 +0300
committerAndrew Dolgov <[email protected]>2019-08-16 15:29:24 +0300
commit3e4701116d9a7a2b93646f2c9aed80b63175d206 (patch)
tree76a6d8664cb7ff9b7bbb2e6da5b3ee434baca59f /classes/handler/public.php
parent865c54abcb5bdfb6d68757cfadccd8383cdc213c (diff)
af_readability: add missing file
Diffstat (limited to 'classes/handler/public.php')
-rwxr-xr-xclasses/handler/public.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/classes/handler/public.php b/classes/handler/public.php
index 05a84494b..91413b976 100755
--- a/classes/handler/public.php
+++ b/classes/handler/public.php
@@ -1203,30 +1203,30 @@ class Handler_Public extends Handler {
public function pluginhandler() {
$host = new PluginHost();
- $plugin = basename(clean($_REQUEST["plugin"]));
+ $plugin_name = clean_filename($_REQUEST["plugin"]);
$method = clean($_REQUEST["pmethod"]);
- $host->load($plugin, PluginHost::KIND_USER, 0);
+ $host->load($plugin_name, PluginHost::KIND_USER, 0);
$host->load_data();
- $pclass = $host->get_plugin($plugin);
+ $plugin = $host->get_plugin($plugin_name);
- if ($pclass) {
- if (method_exists($pclass, $method)) {
- if ($pclass->is_public_method($method)) {
- $pclass->$method();
+ if ($plugin) {
+ if (method_exists($plugin, $method)) {
+ if ($plugin->is_public_method($method)) {
+ $plugin->$method();
} else {
- user_error("pluginhandler: Requested private method '$method' of plugin '$plugin'.");
+ user_error("PluginHandler[PUBLIC]: Requested private method '$method' of plugin '$plugin_name'.", E_USER_WARNING);
header("Content-Type: text/json");
print error_json(6);
}
} else {
- user_error("pluginhandler: Requested unknown method '$method' of plugin '$plugin'.");
+ user_error("PluginHandler[PUBLIC]: Requested unknown method '$method' of plugin '$plugin_name'.", E_USER_WARNING);
header("Content-Type: text/json");
print error_json(13);
}
} else {
- user_error("pluginhandler: Requested method '$method' of unknown plugin '$plugin'.");
+ user_error("PluginHandler[PUBLIC]: Requested method '$method' of unknown plugin '$plugin_name'.", E_USER_WARNING);
header("Content-Type: text/json");
print error_json(14);
}