Every time I create a new discussion or post that is not flagged it Says this in the red window "Oops! Something went wrong. Please reload the page and try again." and under Debug it gives a 201 Created with the following:

POST http://mytestdomain.com/discussions/api/posts

<br />
<b>Warning</b>:  preg_match(): Delimiter must not be alphanumeric or backslash in <b>F:\Server\Websites\mytestdomain\discussions\vendor\issyrocks12\flarum-ext-filter\src\Listener\FilterPosts.php</b> on line <b>77</b><br />
<br />
<b>Warning</b>:  preg_match(): Delimiter must not be alphanumeric or backslash in <b>F:\Server\Websites\mytestdomain\discussions\vendor\issyrocks12\flarum-ext-filter\src\Listener\FilterPosts.php</b> on line <b>77</b><br />
<br />
<b>Warning</b>:  preg_match(): Delimiter must not be alphanumeric or backslash in <b>F:\Server\Websites\mytestdomain\discussions\vendor\issyrocks12\flarum-ext-filter\src\Listener\FilterPosts.php</b> on line <b>77</b><br />
<br />
<b>Warning</b>:  preg_match(): Delimiter must not be alphanumeric or backslash in <b>F:\Server\Websites\mytestdomain\discussions\vendor\issyrocks12\flarum-ext-filter\src\Listener\FilterPosts.php</b> on line <b>77</b><br />
{"data":{"type":"posts","id":"315","attributes":{"id":315,"number":2,"time":"2017-04-26T22:18:17+00:00","contentType":"comment","contentHtml":"\u003Cp\u003Ehey man\u003C\/p\u003E","content":"hey man","ipAddress":"****","canEdit":true,"canDelete":true,"isApproved":true,"canApprove":true,"canFlag":true,"flarum-ext-summaries.excerpt_length":""},"relationships":{"user":{"data":{"type":"users","id":"1"}},"discussion":{"data":{"type":"discussions","id":"70"}},"mentionsPosts":{"data":[]},"upvotes":{"data":[{"type":"users","id":"1"}]},"downvotes":{"data":[]}}},"included":[{"type":"users","id":"1","attributes":{"username":"User-Name","avatarUrl":"http:\/\/mytestdomain.com\/discussions\/assets\/avatars\/v3s2a1g0wzxmgflc.jpg","bio":"User Bio ","joinTime":"2016-06-13T03:33:20+00:00","discussionsCount":21,"commentsCount":2,"canEdit":true,"canDelete":true,"lastSeenTime":"2017-04-26T22:18:17+00:00","isActivated":true,"email":"useremail@gmail.com","antoinefr-money.money":3.96,"canEditMoney":true,"Points":-7,"Rank":"","canActivate":true,"canViewStrike":true,"strikes":null,"gender":null,"age":null,"signature":null,"socialButtons":null,"flarum-ext-summaries.excerpt_length":"","canSuspend":false}},{"type":"discussions","id":"70","attributes":{"title":"Test","slug":"test","commentsCount":2,"participantsCount":1,"startTime":"2017-04-26T22:16:24+00:00","lastTime":"2017-04-26T22:18:17+00:00","lastPostNumber":2,"canReply":true,"canRename":true,"canDelete":true,"canHide":true,"readTime":"2017-04-26T22:18:17+00:00","readNumber":2,"isApproved":true,"canSelectBestAnswer":true,"startUserId":1,"canEditRecipients":true,"canEditUserRecipients":true,"canEditGroupRecipients":true,"isLocked":false,"canLock":true,"canVote":true,"canStrike":true,"canSplit":true,"isSticky":false,"canSticky":true,"subscription":false,"flarum-ext-summaries.excerpt_length":"","canTag":true},"relationships":{"posts":{"data":[{"type":"posts","id":"314"},{"type":"posts","id":"315"}]},"lastUser":{"data":{"type":"users","id":"1"}}}}]}

Once I refresh the page, the post is then made. I also get another 201 Created thrown for any other filtered word other than the first one on my list.

POST http://mydomainname.com/flaruminstalldirectory/api/posts

<br />
<b>Warning</b>:  preg_match(): Delimiter must not be alphanumeric or backslash in <b>F:\Server\Websites\mydomainname\flaruminstalldirectory\vendor\issyrocks12\flarum-ext-filter\src\Listener\FilterPosts.php</b> on line <b>77</b><br />
{"data":{"type":"posts","id":"318","attributes":{"id":318,"number":5,"time":"2017-04-26T22:39:46+00:00","contentType":"comment","contentHtml":"\u003Cp\u003Esons\u003C\/p\u003E","content":"sons","ipAddress":"*******","canEdit":true,"canDelete":true,"isApproved":false,"canApprove":true,"canFlag":true,"flarum-ext-summaries.excerpt_length":""},"relationships":{"user":{"data":{"type":"users","id":"1"}},"discussion":{"data":{"type":"discussions","id":"70"}},"mentionsPosts":{"data":[]},"upvotes":{"data":[{"type":"users","id":"1"}]},"downvotes":{"data":[]}}},"included":[{"type":"users","id":"1","attributes":{"username":"User-Name","avatarUrl":"http:\/\/mydomainname.com\/flaruminstalldirectory\/assets\/avatars\/v3s2a1g0wzxmgflc.jpg","bio":"User Bio ","joinTime":"2016-06-13T03:33:20+00:00","discussionsCount":21,"commentsCount":5,"canEdit":true,"canDelete":true,"lastSeenTime":"2017-04-26T22:39:45+00:00","isActivated":true,"email":"useremail@gmail.com","antoinefr-money.money":5.94,"canEditMoney":true,"Points":-4,"Rank":"","canActivate":true,"canViewStrike":true,"strikes":null,"gender":null,"age":null,"signature":null,"socialButtons":null,"flarum-ext-summaries.excerpt_length":"","canSuspend":false}},{"type":"discussions","id":"70","attributes":{"title":"Test","slug":"test","commentsCount":3,"participantsCount":1,"startTime":"2017-04-26T22:16:24+00:00","lastTime":"2017-04-26T22:22:11+00:00","lastPostNumber":3,"canReply":true,"canRename":true,"canDelete":true,"canHide":true,"readTime":"2017-04-26T22:39:49+00:00","readNumber":5,"isApproved":true,"canSelectBestAnswer":true,"startUserId":1,"canEditRecipients":true,"canEditUserRecipients":true,"canEditGroupRecipients":true,"isLocked":false,"canLock":true,"canVote":true,"canStrike":true,"canSplit":true,"isSticky":false,"canSticky":true,"subscription":false,"flarum-ext-summaries.excerpt_length":"","canTag":true},"relationships":{"posts":{"data":[{"type":"posts","id":"314"},{"type":"posts","id":"315"},{"type":"posts","id":"316"},{"type":"posts","id":"317"},{"type":"posts","id":"318"}]},"lastUser":{"data":{"type":"users","id":"1"}}}}]}

The word entered that flagged this post was "sons"
After refreshing the page the post is shown as flagged
If you press post reply more than once before refreshing, it will post duplicate flagged posts

    Kyrne
    I will give it a shot and report back. Thanks a lot! Great work, love the idea behind this ext. ?

    EDIT: I have also noticed a bug with emails sent out when a post gets flagged. If I do not use HTML tags and just use the default message, everywhere there is a line break, it says the name of my discussion board lol.
    for example, in order to send an email with the default message I had to change it to include <p> tags and no line breaks, I can not copy the message to show exactly what I mean atm because this new update has broken my filters ext

    After trying to enable it I get this error
    "Parse error: syntax error, unexpected ')' in F:\Server\Websites\MyWebsite\flaruminstallpath\vendor\issyrocks12\flarum-ext-filter\src\Listener\FilterPosts.php on line 77

    I also get the same error in SSH when running migrate or clear cache commands

    Another Edit: I fixed the issue myself by deleting the second closing bracket on line 77 in filterpost.php, might want to update that so anyone else who updates doesn't have a broken front and back end

      22 days later
      4 months later
      4 months later

      Kyrne is this still working/supported? I can't get the emails to send out.

      2 months later
      9 months later
      3 months later
      a month later

      Hi, my flarum was not work ,when i install this filter~

      The install output like this:

      Warning: This development build of composer is over 60 days old. It is recommended to update it by running "/usr/bin/composer self-update" to get the latest version.
      Using version 1.2 for issyrocks12/flarum-ext-filter
      ./composer.json has been updated
      Loading composer repositories with package information
      Updating dependencies (including require-dev)
      Package operations: 3 installs, 0 updates, 0 removals

      • Installing flarum/flarum-ext-flags (v0.1.0-beta.8.1): Loading from cache
      • Installing flarum/flarum-ext-approval (v0.1.0-beta.8): Loading from cache
      • Installing issyrocks12/flarum-ext-filter (1.2.2): Loading from cache
        Package flarum/flarum-ext-flags is abandoned, you should avoid using it. Use flarum/flags instead.
        Package flarum/flarum-ext-approval is abandoned, you should avoid using it. Use flarum/approval instead.
        Writing lock file
        Generating autoload files

      The Browser show me this:

      Error booting Flarum: Class Flarum\Core\Repository\PostRepository does not exist

      And the flarum logs like this:

      [2019-05-11 03:05:22] production.ERROR: Flarum\User\Exception\PermissionDeniedException in /www/wwwroot/flarum/vendor/flarum/core/src/User/AssertPermissionTrait.php:25
      Stack trace:
      #0 /www/wwwroot/flarum/vendor/flarum/core/src/User/AssertPermissionTrait.php(37): Flarum\Admin\Middleware\RequireAdministrateAbility->assertPermission(false)
      #1 /www/wwwroot/flarum/vendor/flarum/core/src/User/AssertPermissionTrait.php(64): Flarum\Admin\Middleware\RequireAdministrateAbility->assertCan(Object(Flarum\User\Guest), 'administrate')
      #2 /www/wwwroot/flarum/vendor/flarum/core/src/Admin/Middleware/RequireAdministrateAbility.php(26): Flarum\Admin\Middleware\RequireAdministrateAbility->assertAdmin(Object(Flarum\User\Guest))
      #3 /www/wwwroot/flarum/vendor/zendframework/zend-stratigility/src/Next.php(52): Flarum\Admin\Middleware\RequireAdministrateAbility->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
      #4 /www/wwwroot/flarum/vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
      #5 /www/wwwroot/flarum/vendor/zendframework/zend-stratigility/src/Next.php(52): Flarum\Http\Middleware\SetLocale->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
      #6 /www/wwwroot/flarum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(34): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
      #7 /www/wwwroot/flarum/vendor/zendframework/zend-stratigility/src/Next.php(52): Flarum\Http\Middleware\AuthenticateWithSession->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
      #8 /www/wwwroot/flarum/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
      #9 /www/wwwroot/flarum/vendor/zendframework/zend-stratigility/src/Next.php(52): Flarum\Http\Middleware\RememberFromCookie->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
      #10 /www/wwwroot/flarum/vendor/flarum/core/src/Http/Middleware/StartSession.php(62): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
      #11 /www/wwwroot/flarum/vendor/zendframework/zend-stratigility/src/Next.php(52): Flarum\Http\Middleware\StartSession->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
      #12 /www/wwwroot/flarum/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(29): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
      #13 /www/wwwroot/flarum/vendor/zendframework/zend-stratigility/src/Next.php(52): Flarum\Http\Middleware\ParseJsonBody->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
      #14 /www/wwwroot/flarum/vendor/flarum/core/src/Http/Middleware/HandleErrorsWithView.php(67): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
      #15 /www/wwwroot/flarum/vendor/zendframework/zend-stratigility/src/Next.php(52): Flarum\Http\Middleware\HandleErrorsWithView->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
      #16 /www/wwwroot/flarum/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(83): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
      #17 /www/wwwroot/flarum/vendor/middlewares/request-handler/src/RequestHandler.php(84): Zend\Stratigility\MiddlewarePipe->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
      #18 /www/wwwroot/flarum/vendor/zendframework/zend-stratigility/src/Next.php(52): Middlewares\RequestHandler->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
      #19 /www/wwwroot/flarum/vendor/middlewares/base-path-router/src/BasePathRouter.php(97): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
      #20 /www/wwwroot/flarum/vendor/zendframework/zend-stratigility/src/Next.php(52): Middlewares\BasePathRouter->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
      #21 /www/wwwroot/flarum/vendor/middlewares/base-path/src/BasePath.php(53): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
      #22 /www/wwwroot/flarum/vendor/zendframework/zend-stratigility/src/Next.php(52): Middlewares\BasePath->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
      #23 /www/wwwroot/flarum/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(83): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
      #24 /www/wwwroot/flarum/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(72): Zend\Stratigility\MiddlewarePipe->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\EmptyPipelineHandler))
      #25 /www/wwwroot/flarum/vendor/zendframework/zend-httphandlerrunner/src/RequestHandlerRunner.php(95): Zend\Stratigility\MiddlewarePipe->handle(Object(Zend\Diactoros\ServerRequest))
      #26 /www/wwwroot/flarum/vendor/flarum/core/src/Http/Server.php(46): Zend\HttpHandlerRunner\RequestHandlerRunner->run()
      #27 /www/wwwroot/flarum/public/index.php(22): Flarum\Http\Server->listen()
      #28 {main}

        2 months later
        • [deleted]

        Ralkage Any more thought around this ? I have a very chatty user in my forum who unfortunately likes to litter posts with, shall we say, "undesirable" words 🙂 Having to manually redact at present, but my forum is growing (thanks to Flarum) and performing this manual task is going to become very time consuming !

        8 days later

        [deleted] consider contacting the developers directly to finance the update if you need it fast 😉

        As Ralkage said above a rewrite might be needed, so this might be the reason nothing has been started yet.

        5 days later

        [deleted] somehow missed this in my inbox. A couple of us have discussed and all encompassing "mod tools" extension that would include this extension's features.

        This was the first extension I ever made and it's horrendously coded. If we ditch the above idea I will re-write and update it for the latest Flarum version.

          5 months later

          Kyrne This was the first extension I ever made and it's horrendously coded. If we ditch the above idea I will re-write and update it for the latest Flarum version.

          Would be great to see it happen. I'd be happy to help finance this if needed, I think it's a super important feature that needs to exist.