Hi all,
I am using ColdTrick Contact (https://github.com/ColdTrick/contact) which is a quite helpful & beautiful plugin but i want to add an extra condition to the contact form that is when a user places any link inside the contact form. Kindly note i have Captcha, Spam Login, https block all those plugin & still nothing is working so i thought of this idea ..
So that i will be in peace with flooded Phishing & spam emails hitting on a daily basis.
Thanks in Advance
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- meril@merilturock
meril - 0 likes
- Rohit Gupta@Rohit_1990_3676
Rohit Gupta - 0 likes
- meril@merilturock
meril - 0 likes
// check spam if($message){ if(!preg_match("#^((ht|f)tps?:)?//#i", $message)) { $message= 'http://' . $message; register_error(elgg_echo("contact:message:invalid_message_spam")); } } I am not a good coder can you tell me like what i am missing here ..
- Rohit Gupta@Rohit_1990_3676
Rohit Gupta - 0 likes
- Check if $message is not blank
- Check if $message does not starts with https or ftps then
- Add http to the $message
- Register an elgg error and
- continue to run the code as there is no exit command.
- meril@merilturock
meril - 0 likes
You must log in to post replies.Hello,
Does anyone knows how to make this possible where to add the validation any link is placed in the contact forum message/subject it should not send email at all it should simply reject the message with warning..
Thanks you
Meril
You can add your check in mod/contact/actions/send.php file.
The message is stored in $message variable. Add your check that if any http or https is present in $message then the message will be rejected.
Hello Rohit,
Thanks for your help but it did not stop ..
I thought you wanted to remove URL from your message but the code that you have shared is doing something else.. This is what it does:
Form the code it seems like you want to add a url to your message and not remove it.
Your code should be:
Hello Rohit,
Thanks for your help it worked.. Now i am free from this spammer who miss use my contact form ..
Thanks once again for your valuable time & help ..