diff options
Diffstat (limited to 'classes/pluginhost.php')
-rw-r--r-- | classes/pluginhost.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/classes/pluginhost.php b/classes/pluginhost.php index 592629881..0ef17b77e 100644 --- a/classes/pluginhost.php +++ b/classes/pluginhost.php @@ -21,6 +21,8 @@ class PluginHost { const HOOK_RENDER_ARTICLE = 10; const HOOK_RENDER_ARTICLE_CDM = 11; const HOOK_FEED_FETCHED = 12; + const HOOK_SANITIZE = 13; + const HOOK_RENDER_ARTICLE_API = 14; const KIND_ALL = 1; const KIND_SYSTEM = 2; @@ -170,7 +172,7 @@ class PluginHost { } function add_command($command, $description, $sender) { - $command = "-" . str_replace("-", "_", strtolower($command)); + $command = str_replace("-", "_", strtolower($command)); $this->commands[$command] = array("description" => $description, "class" => $sender); @@ -200,7 +202,7 @@ class PluginHost { function run_commands($args) { foreach ($this->get_commands() as $command => $data) { - if (in_array($command, $args)) { + if (isset($args[$command])) { $command = str_replace("-", "", $command); $data["class"]->$command($args); } @@ -209,7 +211,7 @@ class PluginHost { function load_data($force = false) { if ($this->owner_uid && (!$_SESSION["plugin_storage"] || $force)) { - $plugin = db_escape_string($plugin); + $plugin = db_escape_string($this->link, $plugin); $result = db_query($this->link, "SELECT name, content FROM ttrss_plugin_storage WHERE owner_uid = '".$this->owner_uid."'"); @@ -224,7 +226,7 @@ class PluginHost { private function save_data($plugin) { if ($this->owner_uid) { - $plugin = db_escape_string($plugin); + $plugin = db_escape_string($this->link, $plugin); db_query($this->link, "BEGIN"); @@ -234,7 +236,7 @@ class PluginHost { if (!isset($this->storage[$plugin])) $this->storage[$plugin] = array(); - $content = db_escape_string(serialize($this->storage[$plugin])); + $content = db_escape_string($this->link, serialize($this->storage[$plugin])); if (db_num_rows($result) != 0) { db_query($this->link, "UPDATE ttrss_plugin_storage SET content = '$content' |