Code Monkey home page Code Monkey logo

flarum-email-filter's Introduction

flarum-email-filter

License Latest Stable Version

A Flarum extension. Filter emails registering your Flarum site with whitelist, blacklist and even regular expressions.

This extension is a rewrite of studosi-flarum/mail-filter. Huge thanks to its original author. This rewrite comes with latest Flarum support (v1.0), better admin front-end experience.

Installation

Install manually with composer:

composer require nyu8/flarum-email-filter

Updating

composer update nyu8/flarum-email-filter

Links

An extension by NYU8 Community.

flarum-email-filter's People

Contributors

dizys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flarum-email-filter's Issues

BUG: Type error

#2
Hi ,I'm new to here.
I've install the extension and this type error happens.
ๅœ–็‰‡

Solution:
Remove type prefix (array) for argument "$rules" in function checkRegex and checkLiteral
private static function checkLiteral(string $email, array $rules, bool $caseSensitive = false): bool private static function checkRegex(string $email, array $rules, bool $caseSensitive = false): bool
to
private static function checkLiteral(string $email, $rules, bool $caseSensitive = false): bool private static function checkRegex(string $email, $rules, bool $caseSensitive = false): bool

Correct me if I'm wrong, thanks

There is no nice way to blacklist for all caps patterns

Currently, the mail filter works as intended - it filters using regular expressions and it does it well. However, users may sometimes try to evade blacklists because the extension correctly assumes that the pattern written in some casing corresponds exactly to that casing when validations. This is a fine assumption but might not be ideal because Flarum already considers e-mails case-insensitive, meaning something like [email protected] is the same as [email protected]. The extension, however, doesn't assume this, and if you have a deleted users and a blacklist filter in place, they can bypass it by changing the filter.

For whitelisting purposes, this is fine, because users can just type in a correct mail and that is that. However, for blacklisting purposes, it might be smarter to enable at least a flag which enables case insensitive matching - meaning that before mail validation, if such flag is set, the email to be checked is lowercased before the check is ran.

Currently it seems to me that the only way is to manually specify that it is case insensitive with a pattern like [Aa][Bb]12345\@mail\.com$, but it would probably be better if you could apply this to exact blacklists and whitelists (non-pattern ones) to save on processing time and make the process a bit more straightforward and noob-proof.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.