X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=plugins%2Fnsfw%2Finit.php;h=6a1ae3c65a23958c6a167ed43bb43603daa0b8e8;hb=ed1262d55a01a6ffbefe01eb3b5fc22d33dfad24;hp=a57aa4456dfef2dd4cd170fa1bee6d8ee5158dd8;hpb=82076ce53113be9cc053f8740356e7e1b81e5643;p=tt-rss.git
diff --git a/plugins/nsfw/init.php b/plugins/nsfw/init.php
index a57aa445..6a1ae3c6 100644
--- a/plugins/nsfw/init.php
+++ b/plugins/nsfw/init.php
@@ -23,9 +23,10 @@ class NSFW extends Plugin {
}
function hook_render_article($article) {
- $tags = array_map("trim", explode(", ", $this->host->get($this, "tags")));
+ $tags = array_map("trim", explode(",", $this->host->get($this, "tags")));
+ $a_tags = array_map("trim", explode(",", $article["tag_cache"]));
- if (count(array_intersect($tags, $article["tags"])) > 0) {
+ if (count(array_intersect($tags, $a_tags)) > 0) {
$article["content"] = "
".$article["content"]."
";
}
@@ -34,9 +35,10 @@ class NSFW extends Plugin {
}
function hook_render_article_cdm($article) {
- $tags = array_map("trim", explode(", ", $this->host->get($this, "tags")));
+ $tags = array_map("trim", explode(",", $this->host->get($this, "tags")));
+ $a_tags = array_map("trim", explode(",", $article["tag_cache"]));
- if (count(array_intersect($tags, $article["tags"])) > 0) {
+ if (count(array_intersect($tags, $a_tags)) > 0) {
$article["content"] = "
".$article["content"]."
";
}
@@ -68,9 +70,9 @@ class NSFW extends Plugin {
}
";
- print "";
- print "";
- print "";
+ print_hidden("op", "pluginhandler");
+ print_hidden("method", "save");
+ print_hidden("plugin", "nsfw");
print "";
@@ -88,7 +90,7 @@ class NSFW extends Plugin {
}
function save() {
- $tags = explode(",", db_escape_string($_POST["tags"]));
+ $tags = explode(",", $_POST["tags"]);
$tags = array_map("trim", $tags);
$tags = array_map("mb_strtolower", $tags);
$tags = join(", ", $tags);
@@ -102,5 +104,4 @@ class NSFW extends Plugin {
return 2;
}
-}
-?>
+}
\ No newline at end of file