From 91accba3b925e05231ef116b906e03e4772eb38b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 18 Nov 2022 11:57:34 -0500 Subject: [PATCH 1/2] [nsfw] Match regular words with case sensitivity - Update field description --- nsfw/nsfw.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nsfw/nsfw.php b/nsfw/nsfw.php index f252ffc3..31d17f74 100644 --- a/nsfw/nsfw.php +++ b/nsfw/nsfw.php @@ -64,7 +64,7 @@ function nsfw_addon_settings(App &$a, array &$data) $html = Renderer::replaceMacros($t, [ '$info' => DI::l10n()->t('This addon searches for specified words/text in posts and collapses them. It can be used to filter content tagged with for instance #NSFW that may be deemed inappropriate at certain times or places, such as being at work. It is also useful for hiding irrelevant or annoying content from direct view.'), '$enabled' => ['nsfw-enable', DI::l10n()->t('Enable Content filter'), $enabled], - '$words' => ['nsfw-words', DI::l10n()->t('Comma separated list of keywords to hide'), $words, DI::l10n()->t('Use /expression/ to provide regular expressions')], + '$words' => ['nsfw-words', DI::l10n()->t('Comma separated list of keywords to hide'), $words, DI::l10n()->t('Use /expression/ to provide regular expressions, #tag to specfically match hashtags (case-insensitive), or regular words (case-sensitive)')], ]); $data = [ @@ -125,7 +125,7 @@ function nsfw_prepare_body_content_filter(App $a, &$hook_data) $found = nsfw_find_word_in_item_tags($hook_data['item']['hashtags'], substr($word, 1)); break; default: - $found = stripos($body, $word) !== false || nsfw_find_word_in_item_tags($hook_data['item']['tags'], $word); + $found = strpos($body, $word) !== false || nsfw_find_word_in_item_tags($hook_data['item']['tags'], $word); break; } From ba6f6f11c582ffc35163d7ebbdaa6f65af686d40 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 18 Nov 2022 11:58:10 -0500 Subject: [PATCH 2/2] [nsfw] Update main translation file after updating a string --- nsfw/lang/C/messages.po | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nsfw/lang/C/messages.po b/nsfw/lang/C/messages.po index a44f3e95..150b77d3 100644 --- a/nsfw/lang/C/messages.po +++ b/nsfw/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" +"POT-Creation-Date: 2022-11-18 11:57-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -34,7 +34,9 @@ msgid "Comma separated list of keywords to hide" msgstr "" #: nsfw.php:67 -msgid "Use /expression/ to provide regular expressions" +msgid "" +"Use /expression/ to provide regular expressions, #tag to specfically match " +"hashtags (case-insensitive), or regular words (case-sensitive)" msgstr "" #: nsfw.php:72