]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix nsfw plugin
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 4 Jun 2013 11:34:04 +0000 (15:34 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 4 Jun 2013 11:34:04 +0000 (15:34 +0400)
plugins/nsfw/init.php

index a57aa4456dfef2dd4cd170fa1bee6d8ee5158dd8..79979076b5a833062e4d8ba1b4544b3a1377a924 100644 (file)
@@ -24,8 +24,9 @@ class NSFW extends Plugin {
 
        function hook_render_article($article) {
                $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"] = "<div class='nswf wrapper'><button onclick=\"nsfwShow(this)\">".__("Not work safe (click to toggle)")."</button>
                                <div class='nswf content' style='display : none'>".$article["content"]."</div></div>";
                }
@@ -35,8 +36,9 @@ class NSFW extends Plugin {
 
        function hook_render_article_cdm($article) {
                $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"] = "<div class='nswf wrapper'><button onclick=\"nsfwShow(this)\">".__("Not work safe (click to toggle)")."</button>
                                <div class='nswf content' style='display : none'>".$article["content"]."</div></div>";
                }