Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newlines in email are replaced with the username #49

Open
clarkwinkelmann opened this issue Apr 29, 2024 · 0 comments
Open

Newlines in email are replaced with the username #49

clarkwinkelmann opened this issue Apr 29, 2024 · 0 comments
Labels

Comments

@clarkwinkelmann
Copy link
Member

clarkwinkelmann commented Apr 29, 2024

Bug Report

Current Behavior
The email that the extension can optionally send has all its newlines replaced with the current user username.

On my test forum with User, I receive:

Thank you for posting! Unfortunately, your post was removed because it contained something we don't want to see on our forums.UserUserIf you believe this was an error, you are in luck, each removed post is reviewed by our moderators. If they find that this was wrongfully removed, they will restore it. UserUserThank you for your understanding.User

Steps to Reproduce

  1. Enable Email user when post is filtered
  2. Write post with bad word

Expected Behavior
I can't figure out what that code was supposed to do.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment

  • Flarum version: 1.8.5
  • Extension version: 1.1.3, dev-master
  • Website URL: http://example.com
  • Webserver: apache
  • Hosting environment: local
  • PHP version: 8.1.28

Possible solution(s)
Remove that code?

Since nobody noticed this problem in 7 years, maybe remove the email feature entirely if nobody uses it?

Additional Context
The problem code is here

$linebreaks = ["\n", "\r\n"];
$subject = $this->settings->get('fof-filter.flaggedSubject');
$text = str_replace($linebreaks, $post->user->username, $this->settings->get('fof-filter.flaggedEmail'));

This code has been present since the very first commit in this repo 1f83589

I don't even know where this code originally comes from? Who is that root and why does the first commit message is "Fix for none toggling switch" ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant