1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 03:15:56 +00:00

* implement shortcut syntax for exposed plugin methods

* move shared article rendering code to share plugin
This commit is contained in:
Andrew Dolgov
2021-02-17 09:59:14 +03:00
parent 7adcada324
commit 273ada7353
4 changed files with 180 additions and 167 deletions

View File

@@ -17,6 +17,17 @@
$method = (string)clean($_REQUEST["op"]);
// shortcut syntax for public (exposed) methods (?op=plugin--pmethod&...params)
if (strpos($method, PluginHost::PUBLIC_METHOD_DELIMITER) !== false) {
list ($plugin, $pmethod) = explode(PluginHost::PUBLIC_METHOD_DELIMITER, $method, 2);
// TODO: better implementation that won't modify $_REQUEST
$_REQUEST["plugin"] = $plugin;
$_REQUEST["pmethod"] = $pmethod;
$method = "pluginhandler";
}
$override = PluginHost::getInstance()->lookup_handler("public", $method);
if ($override) {