]> git.mxchange.org Git - friendica-addons.git/commitdiff
nsfw - use regex matching if word starts with '/'
authorfriendica <info@friendica.com>
Thu, 2 Feb 2012 07:40:16 +0000 (23:40 -0800)
committerfriendica <info@friendica.com>
Thu, 2 Feb 2012 07:40:16 +0000 (23:40 -0800)
nsfw.tgz
nsfw/nsfw.php

index 187ef0150cdca3fd8db6f96d465ecb91c77239db..b9dc85be0f2c15b23ec35a722e4b22e7ff89fc2a 100755 (executable)
Binary files a/nsfw.tgz and b/nsfw.tgz differ
index 71880499613d79bc9ed4415f937c740d8a7947a6..332e82245e3e40465e356c47f0d4ce9614233ed1 100755 (executable)
@@ -86,14 +86,21 @@ function nsfw_prepare_body(&$a,&$b) {
                        if(! strlen(trim($word))) {
                                continue;
                        }
-
-                       if(stristr($b['html'],$word)) {
-                               $found = true;
-                               break;
+                       if(strpos($word,'/') === 0) {
+                               if(preg_match($word,$b['html'])) {
+                                       $found = true;
+                                       break;
+                               }
                        }
-                       if(stristr($b['item']['tag'], ']' . $word . '[' )) {
-                               $found = true;
-                               break;
+                       else {
+                               if(stristr($b['html'],$word)) {
+                                       $found = true;
+                                       break;
+                               }
+                               if(stristr($b['item']['tag'], ']' . $word . '[' )) {
+                                       $found = true;
+                                       break;
+                               }
                        } 
                }
        }