Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

4 answers to this question

Recommended Posts

  • 0
Posted

Adauga la inceputul gm-ului

static const antisqlinjection[][] =
{
    "'",
    "#",
    "`",
    "%s",
    "%d",
    "%f",
    "%h",
    "h%"
};

 

adauga la public OnDialogResponse

 

if(strfind(inputtext, "%", true) != -1)
    { 
        SendClientMessage(playerid, COLOR_GENANNOUNCE, "SERVER: Invalid dialog input. You can't use %%.");
        ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, "Invalid dialog input", "Invalid dialog input", "OK", "Exit");
        return 1;
    }
    for(new i; i < sizeof(antisqlinjection); i++)
    {
        if(strfind(inputtext, antisqlinjection, true) != -1)
        {
            SCM(playerid, -1, "Nu sunt permise asemenea caractere.");
            return 1;
        }
    }

 

iar ca public si forward

 

forward CheckCharacters(string[]);
public CheckCharacters(string[])
{
    for(new i; i < sizeof(antisqlinjection); i++)
    {
        if(strfind(string, antisqlinjection, true) != -1)
        {
            return 1;
        }
    }
    return 0;
}

 

  • Upvote 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.