diff options
author | Andrew Dolgov <[email protected]> | 2019-08-16 12:53:51 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-08-16 12:53:51 +0300 |
commit | 88077702f3a517a0c5b3dbf52acc3f2f51bc6c62 (patch) | |
tree | 17da7c296a12ce21368ce260afdf9b7eb2a566c2 /classes/handler/public.php | |
parent | 24f55d5b919d4b39664b245e51c1d7b984a9966c (diff) | |
parent | a2d26867e653d34a80e504478ebe30ff69ef4a33 (diff) |
Merge branch 'master' of git.fakecake.org:tt-rss
Diffstat (limited to 'classes/handler/public.php')
-rwxr-xr-x | classes/handler/public.php | 20 |
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); } |