X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=classes%2Fpluginhandler.php;h=d10343e095057801bca90d5727760df497845a10;hb=HEAD;hp=df7058dcd6d4f78241617e277b7aa481b262dd7c;hpb=19c7350770788edf3ae0bb1fd6d95876667adbf6;p=tt-rss.git diff --git a/classes/pluginhandler.php b/classes/pluginhandler.php index df7058dc..d10343e0 100644 --- a/classes/pluginhandler.php +++ b/classes/pluginhandler.php @@ -5,14 +5,16 @@ class PluginHandler extends Handler_Protected { } function catchall($method) { - global $pluginhost; + $plugin = PluginHost::getInstance()->get_plugin(clean($_REQUEST["plugin"])); - $plugin = $pluginhost->get_plugin($_REQUEST["plugin"]); - - if (method_exists($plugin, $method)) { - $plugin->$method(); + if ($plugin) { + if (method_exists($plugin, $method)) { + $plugin->$method(); + } else { + print error_json(13); + } + } else { + print error_json(14); } } } - -?>