Stop Forum Spam

Started by SleePy, March 21, 2022, 12:11:09 AM

Previous topic - Next topic

erich199

I'm having issues where this is triggering an error in the logs

Type of error: Undefined
2: Undefined array key "sfs_verOptionsMembers"

Seems to be happening when the user is registered and trying to send a pm

SleePy

Quote from: Skhilled on January 16, 2024, 07:52:04 PMIt will not allow me to do it. I've tried on several SMF forums as well as one without any mods on it...only themes are on it. They all say, "Please enter an email address." This happens whether I use a "%, *, or _" with wildcards. And, StopForumSpam is only installed on the first site I mentioned, not any of the others. This was happening before I installed StopForumSpam. I installed it in hopes that it would help.

Use * as the wild card. *.*@gmail.com for example works.

Quote from: erich199 on January 19, 2024, 03:06:12 PMI'm having issues where this is triggering an error in the logs

Type of error: Undefined
2: Undefined array key "sfs_verOptionsMembers"

Seems to be happening when the user is registered and trying to send a pm

Do you have any options set for members?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Ottokar

Quote from: SleePy on January 05, 2024, 07:11:28 PMTry this.
In StopForumSpam.php

Find:
            $guestname = !isset($_POST['guestname']) ? '' : trim($_POST['guestname']);
            $email = !isset($_POST['email']) ? '' : trim($_POST['email']);

Replace:
            $guestname = !isset($_POST['guestname']) ? '' : trim(normalize_spaces(sanitize_chars($_POST['guestname'], 1, ' '), true, true, array('no_breaks' => true, 'replace_tabs' => true, 'collapse_hspace' => true)));
            $email = !isset($_POST['email']) ? '' : trim($_POST['email']);

            // SMF will take care of these if we are checking them.
            if (!empty($this->modSettings['sfs_emailcheck']) && empty($modSettings['guest_post_no_email']) && empty($email))
                return false;
            else if (!empty($this->modSettings['sfs_usernamecheck']) && empty($guestname))
                return false;

It should stop the API from being requested but depends on SMF processing its own checks to reject the submission for an empty username and empty email.

Another thing to note is these are most likely bots, as the UI has a required attribute on the email and username boxes, which should prevent the browser from accepting the post filling them in.
I changed the code 2 weeks ago, until now there where no new error messages about SFS in the SMF-Logs and no Debug entries in the SFS-Logs.
I'll report again in a few weeks.

SleePy

Thanks for the update. https://github.com/jdarwood007/smfmod_sfs/commit/fcfedc9dfddc37fab8583b67b6ab32772557277e

I will get it in the package officially in a few days when I have time to do some last-minute checks for other things I need to update.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

bazzacad

HELP!
I installed this mod & it crashed my site. I can't even get into the forums to uninstall it.
I just get a "This page isn't working - HTTP ERROR 500".
The installation didn't have any errors.
SMF: 2.0.19
PHP: 7.4.22
SFS: 1.5.4

I tried restoring the backup file: https://wiki.simplemachines.org/smf/A_mod_broke_my_forum.
But it didn't help. I still get the same error: "This page isn't working - HTTP ERROR 500".

SleePy

Ask your host how to upgrade to PHP 8.0.

I would also recommend upgrading to SMF 2.1 when you can, but check your mod compatibility.  SMF 2.1 supports PHP 8.1 and higher.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Sudhakar Arjunan

Yes once installed on my fresh upgraded smf 2.1.4 the install page blanks out and completely cashes my Forum.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Skhilled

I've found ound out the the problems I were having was from Google's recaptcha and not StopForumSpam. Once I've disabled Google's recaptcha the problems went away. ;)

It may be possible that they are incompatible somehow???

Lucarella

Hi, I installed this mod, it works but I get a lot of errors like this:
2: Undefined array key "username"
/home/ddcrewne/public_html/forum/Sources/StopForumSpam.php (Linea 457)

Tipo di errore
Undefined_vars
Messaggio di errore
2: Undefined array key "username"
File
/home/ddcrewne/public_html/forum/Sources/StopForumSpam.php
Linea
457
URL della pagina che ha causato l'errore
https://dd-crew.net/forum/index.php?action=signup2
Informazioni di backtrace
#0: smf_error_handler()
Chiamata da /home/ddcrewne/public_html/forum/Sources/StopForumSpam.php nella linea 457
#1: sfsCheckMultiple()
Chiamata da /home/ddcrewne/public_html/forum/Sources/StopForumSpam.php nella linea 391
#2: sfsCheck()
Chiamata da /home/ddcrewne/public_html/forum/Sources/StopForumSpam.php nella linea 178
#3: checkRegisterRequest()
Chiamata da /home/ddcrewne/public_html/forum/Sources/StopForumSpam.php nella linea 146
#4: hook_register()
Chiamata da /home/ddcrewne/public_html/forum/Sources/Subs.php nella linea 5787
#5: call_integration_hook()
Chiamata da /home/ddcrewne/public_html/forum/Sources/Subs-Members.php nella linea 696
#6: registerMember()
Chiamata da /home/ddcrewne/public_html/forum/Sources/Register.php nella linea 531
#7: Register2()
Chiamata da /home/ddcrewne/public_html/forum/index.php nella linea 184

How can I solve it?

Thank you

SleePy

@Lucarella,

Open the Sources/StopForumSpam.php

Find:
$test = call_user_func([$this, 'sfsCheck_' . $key], $response[$key], $area);
Replace:
$test = call_user_func([$this, 'sfsCheck_' . $key], $response[$key] ?? [], $area);
@Skhilled,
Are you on SMF 2.0?  Recaptcha is built into 2.1.  I haven't tested it with 2.0 and the Recpatcha mod installed.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Skhilled

No, I'm on 2.1 and was using Google's recaptcha and added their keys. When I removed it it worked better. :)


KittyGalore

The mod can't be downloaded

An error has occurred
This package appears to have been removed from the remote host. Please contact the mod/theme author to correct.
SMF Curve 2.0x

Steve

It works just fine for me Kitty.
DO NOT pm me for support!

KittyGalore

Very strange i tried another browser and the same result. Firefox and Chrome.
SMF Curve 2.0x

SleePy

Try it now.  Something was odd with GitHub and it stopped wanting to serve the file.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

KittyGalore

Quote from: SleePy on February 18, 2024, 01:39:48 PMTry it now.  Something was odd with GitHub and it stopped wanting to serve the file.
Yes now it's working thanks.
SMF Curve 2.0x

IVIIVI4ck3y27

I've run into an error with our forum upon trying to install the package. I'm getting the HTTP Error 500 as noted above.  I looked in the error log and it's noting this as the only error for today:

[26-Mar-2024 21:58:37 Africa/Abidjan] PHP Parse error:  syntax error, unexpected '|', expecting variable (T_VARIABLE) in /*****/**********/public_html/*********/forum/Sources/StopForumSpam.php on line 1023

I'm not sure on the Africa/Abidjan as the server is located in the Eastern U.S.  I blanked out the server related info and site name info. in the above shared error log comment.

I also can't run fix_packages.php either (it doesn't seem to access it when pointed at it in a browser despite it being in the root of the forum directory with the SSI and Settings.php files) so kind of stuck at the moment. It's an old forum (not active for a # of years) that I just recently updated to 2.0.19 but I'm not sure what version of PHP and MySQL we're on as it's basically been running for awhile with minimal updates.  I have ran into a lot of spammers just recently and disabled registrations. 

I'd like to revert back but obviously (and quite stupidly) I didn't back things up because... why would I? *SMDH*  Hoping I can just get it to uninstall but not sure if there's a means to?

Advertisement: