SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 10/08/2017, 04:31 PM   #1
Bussyman
Big Clucker
 
Join Date: Apr 2017
Posts: 161
Reputation: 0
Default sendmail

Hi,

http://forum.sa-mp.com/showthread.php?t=197755

SendMail function if player can write email, i need to escape before sendmail i can use, or this not need only for mysql funtions?
Bussyman is offline   Reply With Quote
Old 10/08/2017, 04:35 PM   #2
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,535
Reputation: 552
Default Re: sendmail

You might want to protect yourself against HTML injection (if you don't want to allow users to write mails with html in them), but no, escaping (%e) is specifically for protection against SQL injection
Misiur is offline   Reply With Quote
Old 10/08/2017, 04:35 PM   #3
X337
Gangsta
 
Join Date: Sep 2014
Location: Indonesia
Posts: 879
Reputation: 287
Default Re: sendmail

You don't need to escape anything unless you're going to use some email's informations inputted by users into SQL queries.

Edit: Misiur answer's faster and better
__________________
viva la sa-mp
X337 is offline   Reply With Quote
Old 10/08/2017, 04:37 PM   #4
Bussyman
Big Clucker
 
Join Date: Apr 2017
Posts: 161
Reputation: 0
Default Re: sendmail

Code:
stock IsCorrectMail(mail[])
{
	new len = strlen(mail), bool:find[2], w;
 	if(!(6 < len < 129)) return false;
  	for(new l; l < len; l++)
  	{
   		if(mail[l] == '.') find[0] = true;
     	if(mail[l] == '@')
      	{
       		if(find[1]) return false;
         	find[1] = true;
          	w = l;
           	if(w > 64) return false;
       	}
        if(!(mail[l] >= 'A' && mail[l] <= 'Z' || mail[l] >= 'a' && mail[l] <= 'z' || mail[l] >= '0' && mail[l] <= '9' || mail[l] == '.' || mail[l] == '-' || mail[l] == '_' || mail[l] == '@')) return false;
   	}
    if(len - w > 65) return false;
    if(!find[0] || !find[1]) return false;
    return true;
}
So i with this check email player input, so this protect that player not write mails with html?
Bussyman is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] SendMail Mandrack_FreeZe Lançamentos/Releases 12 05/10/2014 01:32 PM
error 017: undefined symbol "SendMail" romsisx Scripting Help 3 31/05/2014 04:11 AM
[Ajuda] função SendMail Schocc Português/Portuguese 12 05/01/2013 02:25 AM
[Include] SendMail Dolby Includes 12 07/12/2012 03:52 PM


All times are GMT. The time now is 01:49 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.