]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pluginhandler.php
pngcrush.sh
[tt-rss.git] / classes / pluginhandler.php
index df7058dcd6d4f78241617e277b7aa481b262dd7c..d10343e095057801bca90d5727760df497845a10 100644 (file)
@@ -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);
                }
        }
 }
-
-?>