Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread Ivo F.A.C. Fokkema
In case anyone's interested, here's the function I use in the open source project LOVD to undo Magic Quoting on all GPC arrays: function lovd_magicUnquote ($var = '') { if (!$var) { if (count($_GET)) { lovd_magicUnquote( $_GET); } if (count($_POST)) {

Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread afan
hm. good idea. actually, it's, at least, the most safe way. :) thanks. -afan [EMAIL PROTECTED] wrote: Hi to all. Have a web site on server where magic quote is turned On. Because of problems with quotes within forms, I was thinking to turn it Off. I wonder how much work I'll have to

Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread afan
This is what I found and started to use: created magic_quotes_off.php if (get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);

Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread Richard Lynch
On Wed, August 9, 2006 9:07 am, [EMAIL PROTECTED] wrote: Have a web site on server where magic quote is turned On. Because of problems with quotes within forms, I was thinking to turn it Off. I wonder how much work I'll have to change code to accept new setting? Are we talking about major

Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread afan
good idea! :) thanks richard! -afan On Wed, August 9, 2006 9:07 am, [EMAIL PROTECTED] wrote: Have a web site on server where magic quote is turned On. Because of problems with quotes within forms, I was thinking to turn it Off. I wonder how much work I'll have to change code to accept new

Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread Richard Lynch
On Thu, August 10, 2006 7:54 am, [EMAIL PROTECTED] wrote: This is what I found and started to use: created magic_quotes_off.php if (get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ?

Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread afan
My thought was to use this until I do all changes. Once the changes are done - turn off magic_quote_gpc in php.ini. but, agree, redo whole site on separate place (under 'new' or on other box) is much better solution. -afan On Thu, August 10, 2006 7:54 am, [EMAIL PROTECTED] wrote: This is

[PHP] problem with quotes (single and double) in forms

2006-08-09 Thread afan
Hi to all. Have a web site on server where magic quote is turned On. Because of problems with quotes within forms, I was thinking to turn it Off. I wonder how much work I'll have to change code to accept new setting? Are we talking about major changes or something that could be done in day or two

Re: [PHP] problem with quotes (single and double) in forms

2006-08-09 Thread Chris
[EMAIL PROTECTED] wrote: Hi to all. Have a web site on server where magic quote is turned On. Because of problems with quotes within forms, I was thinking to turn it Off. I wonder how much work I'll have to change code to accept new setting? Are we talking about major changes or something that

Re: [PHP] problem with quotes (single and double) in forms

2006-08-09 Thread J R
try to use this few lines of code. function stripMagicQuotes($var) { if (get_magic_quotes_gpc()) { $var= stripslashes($var); } return $var; } this way you don't really have to worry if magic quotes is on or off. ** On 8/10/06, Chris [EMAIL PROTECTED] wrote: [EMAIL

Re: [PHP] problem with quotes (single and double) in forms

2006-08-09 Thread Chris
J R wrote: try to use this few lines of code. function stripMagicQuotes($var) { if (get_magic_quotes_gpc()) { $var= stripslashes($var); } return $var; } this way you don't really have to worry if magic quotes is on or off. Then he has to modify all the code to call that

Re: [PHP] problem with quotes (single and double) in forms

2006-08-09 Thread Chris
Chris wrote: J R wrote: try to use this few lines of code. function stripMagicQuotes($var) { if (get_magic_quotes_gpc()) { $var= stripslashes($var); } return $var; } this way you don't really have to worry if magic quotes is on or off. Then he has to modify all the code

Re: [PHP] problem with quotes (single and double) in forms

2006-08-09 Thread J R
here's an improvement jwith recursion: function stripMagicQuotes($var) { if (get_magic_quotes_gpc()) { if(!is_array($var)) { $var= stripslashes($var); } else { array_walk($var, stripMagicQuotes); } } return $var; } hth, john On 8/10/06,

Re: [PHP] problem with quotes (single and double) in forms

2006-08-09 Thread Chris
Chris wrote: Chris wrote: J R wrote: try to use this few lines of code. function stripMagicQuotes($var) { if (get_magic_quotes_gpc()) { $var= stripslashes($var); } return $var; } this way you don't really have to worry if magic quotes is on or off. Then he has to modify