Posted: 12/08/2009 07:12 AM

Filtering out Emails and URLs from Messages

Ramil just did his thing to help me stop three type of spammers/hustlers to my site.
 
1. Female hustler who provides members her email account so they can hustle the poor soul on her own turf
 
2. Male hustlers (we have a few) who are equivalent to female hustlers promising the ladies a job, visa, etc for their precious pennies (I can't believe we have men trying to hustle poor Asian women).
 
3. Webmaster spammers who spam my site with their site URL to steal members.
 
INSTRUCTIONS (note: tested on 2.5.3 but should work on all 2.5.x versions - always backup before making changes)
 
FNS.MISC.PHP
 
Open: includes/fns/fns.misc.php
 
Find: preg_quote($word,'/')
 
Replace with: $word
 
Control Panel
 
Now we need to make sure we add the filter and that your settings are correct in your control panel. Note that the following instructions are for 2.5.3. If you are using a different version of vldPersonals, your settings may be located in a different area of the CP.
 
ADDING THE FILTER IN THE CP:
 
Go to: Settings - Member modules - from drop down choose Messaging - add the following code to your Filtered words to block out emails and URLs from messages:
 
[A-Za-z0-9_\.\-]+@[A-Za-z0-9_\.\-]+\.[A-Za-z]{2,6}
[A-Za-z0-9_\.-]+\.[a-zA-Z]{2,4}
 
CHECKING YOUR PERMISSIONS
 
Your permissions are probably set correctly by default, but if you want to check to be sure, do this in your CP:
 
- CP - Settings - member groups - Admins - Member Profile Privileges - Enforce Word Filter = No
 
- CP - Settings - member groups - Regular Members - Member Profile Privileges - Enforce Word Filter = Yes
 
Continue checking/setting privileges as you desire for each group. In the above, most webmasters would have the Admin setting set to NO so the admin is not filtered. However, for all other groups you would want to set the filter to YES for each group you want to filter out emails and URLs when they send a message.
 
TESTING
 
If you want to test it out, be sure to do so as Regular members (not admin). You may have to create some dummy accounts to test.
 
Thanks Ramil...I know it took you some time to research and figure this out. I appreciate your support and effort
Current mood:

Comments

by godyn 04/27/2010 01:43 AM
I disabled the function, since it removes all email entries in other fields also, wich I need for administration.
I should only work on certain fields.
by gugu 03/30/2010 05:30 AM
Godyn ask:
Does the normal block function still work if the code is changed in this way?
Find: preg_quote($word,'/') => Replace with: $word
 
My answer:
No I don´t think it will work. I try it and can´t use the old word block functions now. Maybee I did something wrong ... if it should work please tell me.
by spydera 02/24/2010 02:39 AM
What about the wiseguys who resort to formats such as s0meuser at yah00 dot c0m ????? Dittto on URL's also
by gugu 01/26/2010 12:38 PM
thanks I will try it too ...
by esmith813 01/21/2010 03:52 PM
Nice..Thanks Rami. Really appreciate this. I have in my 2.5.5.
by godyn 01/20/2010 05:35 AM
I'm not sure about the mod:
Does the normal block function still work if the code is changed in this way?
Find: preg_quote($word,'/') => Replace with: $word
 
Also, I know the problem, but some spammer are very inventive.
So they use
 
mysite
dt
cOm
 
or something.
I see it happening all the time, also for emails on an other site I use.
by db3204 12/09/2009 02:51 PM
Just for fun....I tried to figure out the regular expression in the above tutor. Ramil is a wizard at understanding this stuff while it seems to give me a headache.
 
First filter I will try to understand is the one used for emails -- for example to find the email bob@yahoo.com you use this experssion
 
[A-Za-z0-9_\.\-]+@[A-Za-z0-9_\.\-]+\.[A-Za-z]{2,6}
 
[
 
A-Z matches all characters between A and Z
 
a-z matches all characters betwee a and z
 
0-9 matches all numbers beween 0 and 9
 
_\.\- NOT SURE WHAT THIS DOES??
 
]
 
+@ I think the + signs means to literally match the character @
 
[
 
A-Za-z0-9 this string of characters have the same meaning as above.
 
_\.\- NOT SURE WHAT THIS DOES??
 
]
 
+\, not sure, but I think this represents the period. NOT SURE WHY we use the \ while in the @ we did not??
 
[
 
A-Za-z same as the above
 
]
 
{2,6} NOT SURE WHAT THIS DOES??
 
THE EXPESSION USED FOR URL - for example: www.vldcrowd.com
 
[A-Za-z0-9_\.-]+\.[a-zA-Z]{2,4}
 
[
 
A-Z find all characters between A and Z
 
a-z find all characters between a and z
 
0-9 find all numbers between 0 and 9
 
_\.- NOT SURE WHAT THIS DOES??
 
]
 
+\. DOES THIS REPRESENT THE FIRST PERIOD??
 
[
 
a-zA-Z same as above
 
{2,4} NOT SURE WHAT THIS DOES??
 
Anyone else want to guess??
by db3204 12/09/2009 06:08 AM
Another option is to only filter out URLs and not emails. I had webmasters joining my site and was providing their URL in their spam message for my members to join their site. Basically they were stealing my members.
Add Comment


You have 1500 characters left We would not recommend you trying hard while expressing your opinion because you are not signed in and comment will not be saved.

Latest visitors

inatmo milojko78 14m3r
mario702 Invision antoniopuntieri
db3204 gugu adboy

db3204's RSS

Subscribe to db3204's Blog  RSS