Re: addslashes 3 and 4
| From: | David Robley | Date: | Fri, 27 Oct 2000 01:31:41 +0000 |
| Subject: | Re: addslashes 3 and 4 | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-22247@lists.php.net to get a copy of this message | ||
On Thu, 26 Oct 2000, Michael Hall wrote:
> I never really got a definitive answer on this ... as with most things, I
> found a fix, fixed it, and moved on. None of this is gospel, but ...
>
> I believe that by default PHP4 automatically adds slashes to anything that
> needs it, so using addslashes() adds yet another set of redundant slashes.
> Whether this is because something that was already available as an option in
> PHP3 is now simply enabled by default, or because of some other mechanism, I
> don't know. To get my PHP3 scripts working under PHP4 I simply commented out
> any addslashes() statements and everything worked fine. So the answer seems
> to be "don't use addslashes() at all". All this could be dependant on how
> you (or an rpm) configured PHP during install. I never touched
> magic_quotes_gpc. Hope this works for you.
>
> Michael Hall
>
> ----- Original Message -----
> From: Stewart Macdonald <smacdonald@chac.qld.edu.au>
> To: <mulgaweb@mulga.com.au>
> Sent: Thursday, October 26, 2000 6:12 PM
> Subject: Re: [PHP] addslashes 3 and 4
>
>
> > > Hi all:
> > > I have a script using addslashes() to deal with user input that worked
> in
> > > PHP3 but appears to be broken in PHP4. How do 3 and 4 differ in their
> > > treatment of addslashes? I've had a look at the manual and archives, but
> not
> > > found a clear answer. How should a PHP3 script using addslashes() be
> > > modified to work in PHP4? Don't use addslashes() at all? Would using
> > > magic_quotes_gpc avoid the issue altogether?
> > > Thanks
> > > Mulga Mick
> >
> > Mulga Mick(?!?!),
> >
> > I have just seen the above message. You posted it to a PHP mailing list at
> > some stage. I'm wondering if you ever found an answer? I'm currently
> trying
> > to figure out why my PHP3 scripts don't work properly with PHP4.
> >
> >
> >
> > Thanks in advance,
> >
> >
> >
> > Stewart Macdonald
> > Brisbane
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
Check out the settings for magic_quotes_gpc and magic_quotes_runtime in your
ini files for the two versions. Depending on which of the sample ini files
from PHP4 you have used, and the extent of modifications you have made....
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA