ttrss/classes/pluginhandler.php

24 lines
639 B
PHP
Raw Normal View History

2012-12-23 11:52:18 +01:00
<?php
class PluginHandler extends Handler_Protected {
function csrf_ignore($method) {
return true;
}
function catchall($method) {
2019-08-16 14:29:24 +02:00
$plugin_name = clean($_REQUEST["plugin"]);
$plugin = PluginHost::getInstance()->get_plugin($plugin_name);
2012-12-23 11:52:18 +01:00
2013-03-16 09:26:14 +01:00
if ($plugin) {
if (method_exists($plugin, $method)) {
$plugin->$method();
} else {
2019-08-16 14:29:24 +02:00
user_error("PluginHandler: Requested unknown method '$method' of plugin '$plugin_name'.", E_USER_WARNING);
print error_json(13);
2013-03-16 09:26:14 +01:00
}
} else {
2019-08-16 14:29:24 +02:00
user_error("PluginHandler: Requested method '$method' of unknown plugin '$plugin_name'.", E_USER_WARNING);
print error_json(14);
2012-12-23 11:52:18 +01:00
}
}
}