Removing ' from nick
Hello, if someone has single quotes in nick name (pwn'd), my plugin that uses SQL connection crashes if it tries to put the nickname into database because of non-escaped character that breaks the query. I tried removing it from the nickname by using replace(name, 31, "'", ""), but it didn't do anything; the single quotes still remain not removed.
How can I possibly remove the single quotes from one's nickname? |
Re: Removing ' from nick
try "^'"
|
Re: Removing ' from nick
Escaping like ^' doesn't work in MySQL, it has to be defined in database which I don't have access to.
// I just want to remove the ' character from the string, but as I said, replace(name, 31, "'", "") does nothing. |
Re: Removing ' from nick
replace_all(name, 31, "^'", "")
|
Re: Removing ' from nick
Oh, okay, didn't get it soz
|
Re: Removing ' from nick
with my test, replace_all(a, sizeof(a)-1, "'", "") is fine too...
|
Re: Removing ' from nick
You could just add \ in front of any single quotes so that the stored name contains the ' but doesn't affect the SQL query.
Still, isn't there a safe query input function in amxx already ? |
Re: Removing ' from nick
Quote:
|
| All times are GMT -4. The time now is 03:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.