]> git.mxchange.org Git - friendica-addons.git/commitdiff
Fix errors in nsfw addon
authorArt4 <art4@wlabs.de>
Sat, 30 Nov 2024 19:50:06 +0000 (19:50 +0000)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 12 Dec 2024 21:37:42 +0000 (22:37 +0100)
nsfw/nsfw.php

index 4a54d899e201c2eb9d77477a2def9679fef945e8..674fc201266470ec1a7576794cdf6a315c591285 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-use Friendica\App;
 use Friendica\Core\Hook;
 use Friendica\Core\Renderer;
 use Friendica\DI;
@@ -119,7 +118,9 @@ function nsfw_prepare_body_content_filter(&$hook_data)
                $word_list = ['nsfw'];
        }
 
-       $found = false;
+       $found      = false;
+       $tag_search = false;
+
        if (count($word_list)) {
                $body = $hook_data['item']['title'] . "\n" . nsfw_extract_photos($hook_data['item']['body']);
 
@@ -129,7 +130,6 @@ function nsfw_prepare_body_content_filter(&$hook_data)
                                continue;
                        }
 
-                       $tag_search = false;
                        switch ($word[0]) {
                                case '/'; // Regular expression
                                        $found = @preg_match($word, $body);