Requests: Maybe look at blocking registration of usernames containing words on that list? Or a separate list (e.g. you might want to block someone from registering with admin in their name, but not restrict someone from writing admin in their post).

As for moderator emails, I wouldn't do that (because you could cause a site to be tagged a spammer by submitting multiple posts with filtered words on purpose and triggering emails). It'd be better to inform users as they try to post instead with a red error bar, and not let the post be submitted. Or tap into the Approval mod to auto-unapprove any post that the filter flags, Flag it and let moderators choose to approve it or delete it.

Btw, you should also require flarum-ext-flags in your composer.json if you're going to use Flags.

EDIT (and quoting to save time and properly source my answer):

luceos you can check if an extension is enabled by loading ExtensionManager in your code via IoC, an example of such an implementation:

https://github.com/flagrow/byobu/blob/7c2677b158d58bab75bacbb1b37cfb4f02b8deee/src/Traits/ProvidesAccess.php#L39
https://github.com/flagrow/byobu/blob/7c2677b158d58bab75bacbb1b37cfb4f02b8deee/src/Access/DiscussionPolicy.php#L27

Or you can ioc bind the Flarum Settings Repository and read the right field related to the extensions installed.

You might want to check that Approval and Flags are enabled before calling their actions, too, just to stop errors.

    jordanjay29 0E800

    Update 1.0.5 Added Email customization and html support

    In response to you jordanjay29

    1. I'll add that to the to do list

    2. Mod emails can be turned off. Also, the extension already does that, the posts get unapproved and flagged.

    Edit: Question: how can I make one of those red bars pop up? I know how to do die but that shows an error has occurred and not a custom message

      Kyrne Might be out of scope for Flarum atm. Could be a feature request, though.

      Anyway, looks good, and I'm looking forward to regex support.

        Kyrne Please tell me you drink beer. If not let me atleast buy you some coffee.
        You have a pp link?

          0E800 you are way too kind ☺

          If you really feel like donating my pp is https://www.paypal.me/CDK2020

          If you have any requests for this extension or any separate extension (within reason) let me know!

            Kyrne
            I don't get much opportunity to show appreciation. Mostly I am just poor, but I really admire your pro-active dev on these extensions. Making Flarum better for everyone.

            Hmm what am I doing wrong?

            $ sudo composer update issyrocks12/flarum-ext-filter
            Loading composer repositories with package information
            Updating dependencies (including require-dev)
            Nothing to install or update
            Generating autoload files
            
            $ sudo composer remove issyrocks12/flarum-ext-filter
            Loading composer repositories with package information
            Updating dependencies (including require-dev)
              - Removing issyrocks12/flarum-ext-filter (1.0)
            Writing lock file
            Generating autoload files
            
            $ sudo composer require issyrocks12/flarum-ext-filter
            Using version ^1.0 for issyrocks12/flarum-ext-filter
            ./composer.json has been updated
            Loading composer repositories with package information
            Updating dependencies (including require-dev)
              - Installing issyrocks12/flarum-ext-filter (1.0)
                Loading from cache
            Writing lock file
            Generating autoload files

            Im not getting 1.0.6?

            Im also unable to give you beer money:

            There's a problem

            This recipient is currently unable to receive money.

            If you continue to encounter problems, please contact customer service.

              0E800 I'm more interested in fixing the extension issue, I'll get back to you on the paypal problem later.

              Try now, it should work. If it doesn't explicitly specify 1.0.6 in your composer.json

                Kyrne

                $ sudo composer update issyrocks12/flarum-ext-filter
                Loading composer repositories with package information
                Updating dependencies (including require-dev)
                Nothing to install or update
                Generating autoload files
                
                $ sudo composer remove issyrocks12/flarum-ext-filter
                Loading composer repositories with package information
                Updating dependencies (including require-dev)
                  - Removing issyrocks12/flarum-ext-filter (1.0)
                Writing lock file
                Generating autoload files
                
                $ sudo composer require issyrocks12/flarum-ext-filter
                Using version ^1.0 for issyrocks12/flarum-ext-filter
                ./composer.json has been updated
                Loading composer repositories with package information
                Updating dependencies (including require-dev)
                Your requirements could not be resolved to an installable set of packages.
                
                  Problem 1
                    - Installation request for issyrocks12/flarum-ext-filter ^1.0 -> satisfiable by issyrocks12/flarum-ext-filter[1.0.6].
                    - issyrocks12/flarum-ext-filter 1.0.6 requires flarum-flarum-ext-flags ^v0.1.0-beta.6 -> no matching package found.
                
                Potential causes:
                 - A typo in the package name
                 - The package is not available in a stable-enough version according to your minimum-stability setting
                   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
                
                Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
                
                Installation failed, reverting ./composer.json to its original content.

                Ill try manually editing composer.json

                Or maybe I need to install the Flag extension?

                  0E800 I see the problem, that was completely my fault. I pushed out an update 1.0.6.1 that fixes this

                  A typo in the package name 

                    Kyrne
                    Bingo!

                    $ sudo composer require issyrocks12/flarum-ext-filter
                    Using version 1.0.6.1 for issyrocks12/flarum-ext-filter
                    ./composer.json has been updated
                    Loading composer repositories with package information
                    Updating dependencies (including require-dev)
                      - Installing issyrocks12/flarum-ext-filter (1.0.6.1)
                        Downloading: 100%
                    Writing lock file
                    Generating autoload files

                      Here is a updated screenshot of the current extension 1.0.6.1:

                      Edit: Apologies for the profanity, it is not on purpose.

                      Yeah if possible, let's link and not embed our word lists for this one.

                        jordanjay29 I blurred the offensive words. Wont happen again.

                        Helpful link for filtering shortened urls:
                        https://sirbz.com/u/list-of-url-shorteners

                        • 1url.com
                          adf.ly
                          bc.vc
                          bit.do
                          bit.ly
                          bitly.com
                          buzurl.com
                          cur.lv
                          cutt.us
                          db.tt
                          filoops.info
                          goo.gl
                          is.gd
                          ity.im
                          j.mp
                          link.zip.net
                          lnkd.in
                          ow.ly
                          po.st
                          prettylinkpro.com
                          q.gs
                          qr.ae
                          qr.net
                          scrnch.me
                          t.co
                          tinyarrows.com or http://âž¡.ws/
                          tinyurl.com
                          tr.im
                          tweez.me
                          twitthis.com
                          u.bb
                          u.to
                          v.gd
                          vzturl.com
                          x.co
                          yourls.org

                        Kyrne

                        May you please test the email function. I am noticing differences between your version 1.0 and 1.0.6.1.

                        See the difference:

                        Version 1.0:

                        Version 1.0.6.1:

                        You can see its missing the Subject and the message.
                        I did not change the default email message.

                          0E800 I did not change the default email message.

                          Here lies the problem, my code assumed that people would change the default message. When it wasn't changed, there was no "email text" to grab from the database making it empty. 1.0.6.3 checks if it is set, if it isn't it sets it to the default.

                            Now fix your pp link, you deserve a 6pack.

                            25 days later

                            Kyrne
                            Getting this Nginx error:

                            PHP message: PHP Warning:  preg_match(): Delimiter must not be alphanumeric or backslash in /var/www/keysndaggers/vendor/issyrocks12/flarum-ext-filter/src/Listener/FilterPosts.php on line 65" while reading response header from upstream, client: 70.213.0.4, server: keys-daggers.org, request: "POST /api/posts/105 HTTP/2.0", upstream: "fastcgi://unix:/var/run/php7-fpm.keysdaggers.sock:", host: "keys-daggers.org", referrer: "https://keys-daggers.org/d/42-test/6"
                            ubuntu@v22017014258144095:/var/www/keysndaggers$

                            I have been running composer update so I might have updated other packages that is causing it.

                              0E800 I need a bit more info. Are you using regex? Send me a photo of your filtered words (please don't embed it).