s07e04 - Help stop URL Spammers QUESTIONS/SUPPORT

Open to all! Ask other shopowners for help.
Post Reply
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

s07e04 - Help stop URL Spammers QUESTIONS/SUPPORT

Post by heatherbell »

Addon:
Helps to stop URL Spammers using your Contact Form etc

Download:
viewtopic.php?f=28&t=279



--



Testing on 1.0.8.21, allowed a customer to register with http://i-am-a-spammer.com

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: s07e04 - Help stop URL Spammers

Post by ecartz »

Maybe

Code: Select all

<script>$('#inputFirstName, #inputLastName, #inputFromName').attr('pattern', '^[^:/.]+$');</script>
in includes/hooks/shop/siteWide/attr.php
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: s07e04 - Help stop URL Spammers

Post by heatherbell »

ecartz wrote: Sun Dec 17, 2023 12:30 am Maybe
No, can still register with http://i-am-a-spammer.com as name.
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: s07e04 - Help stop URL Spammers

Post by burt »

Strange how that stopped working.

Try:

Code: Select all

$('#inputFirstName, #inputLastName, #inputFromName').attr('pattern', '(?!.*:/.*).*');
Image:
sp.jpg
This should stop any name with ":/" as part of it. It would not stop (eg) www.i-am-a-spammer.com

It would also need to be thoroughly tested to ensure that real names are let through. I can't imagine anyone has a name with :/ in it?

Caveat that this attribute is added by javascript so would only work with .js turned on. Lots of people (myself included) browse with .js turned off by default. If someone wanted it to work without .js, it would just mean overriding the relevant customer_data modules and inserting a pattern, something like [note I have not tried this but it should work];

Code: Select all

$input = new Input('firstname', [
   'id' => $input_id,
   'autocomplete' => 'given-name',
   'placeholder' => ENTRY_FIRST_NAME_TEXT,
   'minlength' => ENTRY_FIRST_NAME_MIN_LENGTH,
   'pattern' => '(?!.*:/.*).*',
 ]);
You do not have the required permissions to view the files attached to this post.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply