![]() |
string.escape()
string.escape() places a backslash in front of quotation marks. SQLite doesn't require quotation marks to be escaped at all, so ideally it should be fixed, and another function should be added (if needed) for MySQL support (accounts database?).
|
... Wha? That's what escaping is, and the point of escaping is to prevent SQL injections, not because SQLite can't handle quotation marks. :\
|
Quote:
If you feed SQLite as string such as: PHP Code:
PHP Code:
PHP Code:
PHP Code:
Unlike single quotations, quotation marks don't need to be escaped, and escaping them only makes strings enter incorrectly. I think maybe you thought I was referring to single quotes instead of quotation marks in my post, sorry; could've been more clear about that. |
Quote:
|
bump
|
What makes you think escape() is for sqlite?
|
Quote:
|
Well that is rather ridiculous considering sql has different escaping rules than everything else
my apologies, but, uh, just do not do it anyway. |
Quote:
My reaction: http://inverness.dreamhosters.com/images/facepalm.jpg |
This is still a problem after the NPC-server update :(
|
Quote:
|
Quote:
|
Quote:
So really, the proper way to go about this is always use single quotes and only escape single quotes (go ahead and make your own function). But escaping both leaves no room for injection, only room for extra backslashes, which can be fixed. |
Quote:
|
Quote:
|
Quote:
|
Modified Dusty's replacetext() function into a simple stripslashes() function. It wakes into account new lines (\n). I don't know if there's more to take into account, since I really only needed to script something so that it doesn't ruin new lines.
PHP Code:
|
This is absolutely ridiculous. This should have been fixed six months ago. Why hasn't it been done?
|
Quote:
|
Quote:
|
16 months later...
|
Ok will add a new function escapestring2(string).
If that function is tested and fine then we can also integrate it similar to escapestring(string) which is additionally mapped to string.escape(). |
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 02:16 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.