There's been a lot of code injection and sql injection going on around lately...
went through several articles about SQL injection as well as documented exploits in popular php software such as vBulletin...
Now.. it seems that SQL Injection is mainly present if a variable/string is being passed to the database without escaping quotes..
i've sum up 2 most common tips to avoid SQL injection
1) always addslashes your strings if magic quotes are off on your server
2) use mysql's addslashes built in routine to do so.
but i was thinking. if quote is the root problem of this big issue, why not just enable magic_quotes_gpc = ON, or turning it on during runtime, or embed on top of your scripts addslash routines if magic quotes are off such as:
if(get_magic_quotes_gpc){
$GET = array_map(addslashes,$GET);
}
...and be done with it....
I was also thinging, better yet, forget addslahses.. if you dont wana mess with adding and stripping slashes all the time, why not simply convert quotes to "%27" or some other form?
..... just that.. i dont see what's the big deal with all the big talk about techniques, and special methods, etc etc.. i could be missing something here.. or i could be in the right track for thinking this is such a simple problem that's just overlooked with carelessness at times.
hmm. sorry, i guess reading all these articles got me paranoid and confused..