Re: [PHP] addslashes() vs. magic_quotes_gpc

2003-10-19 Thread Adrian
I think always using addslashes is better because you have to write clean cide instead of trusting in a funktion which can be disabled on some servers. To avoid double-escaping I use this code: function stripslashes_array($array) { reset($array); while(list($key,$val)=each($array)) { if(is_

Re: [PHP] addslashes() vs. magic_quotes_gpc

2003-10-19 Thread Rasmus Lerdorf
If you are doing both addslashes() and have magic_quotes_gpc turned on, then yes, you are double-escaping things. >From a performance-perspective I doubt you could measure much difference, but I suppose doing it through magic_quotes_gpc would be faster assuming you need to escape all your GPC d