fix nsfw for tag array
authorfriendica <info@friendica.com>
Tue, 9 Jul 2013 00:41:48 +0000 (17:41 -0700)
committerfriendica <info@friendica.com>
Tue, 9 Jul 2013 00:41:48 +0000 (17:41 -0700)
nsfw.tgz
nsfw/nsfw.php

index da2890e..9d34dc0 100755 (executable)
Binary files a/nsfw.tgz and b/nsfw.tgz differ
index 9a40416..3f00a2f 100755 (executable)
@@ -144,13 +144,16 @@ function nsfw_prepare_body(&$a,&$b) {
                                        $found = true;
                                        break;
                                }
-                               if(stristr($b['item']['tags'], '>' . $word . '<' )) {
-                                       $found = true;
-                                       break;
+                               if(is_array($b['item']['tags']) && count($b['item']['tags'])) {
+                                       foreach($b['item']['tags'] as $t) {
+                                               if(stristr($t, '>' . $word . '<' )) {
+                                                       $found = true;
+                                                       break;
+                                               }
+                                       }
                                }
                        } 
-               }
-               
+               }               
        }
        if($found) {
                $rnd = random_string(8);