Re: 8.1.4: Who says "PHP deprecated addslashes since

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Erik Jones <erik(at)myemma(dot)com>
Cc: ljb <ljb220(at)mindspring(dot)com>, pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: 8.1.4: Who says "PHP deprecated addslashes since
Date: 2006-05-26 14:33:43
Message-ID: 1148654023.25526.60.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2006-05-26 at 08:58, Erik Jones wrote:
> ljb wrote:
> > tgl(at)sss(dot)pgh(dot)pa(dot)us wrote:
> >
> >> ljb <ljb220(at)mindspring(dot)com> writes:
> >>
> >>> | addslashes() or magic_quotes. We note that these tools have been deprecated
> >>> | by the PHP group since version 4.0.
> >>>
> >>> Can anyone provide a source for the statement?
> >>>
> >> I'm not going to put words in Josh's mouth about where he got that from,
> >> but anyone who reads all of the comments at
> >> http://us3.php.net/manual/en/function.addslashes.php
> >> ought to come away suitably unimpressed with the security of that
> >> function.
> >>
> >
> > Yes, sorry, I did see those comments, although I don't think they are from
> > the PHP group themselves. But I missed the statement on the pg_escape_string
> > manual page saying "use of this function is recommended instead of
> > addslashes()". I still think "since version 4.0" is wrong.
> >
> Better yet, use PEAR::DB or some other db abstraction package that will
> handle all of this for you.

Or, if you're going to use the native pgsql interface, you can always
use prepared queries.

http://www.php.net/manual/en/function.pg-prepare.php

Actually, other than still not having error numbers (just the error
messages, seems like "priority inversion" to me, btw) the pgsql
interface in php is quite robust. You can even run async queries with
it.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message carlosreimer 2006-05-26 14:35:19 RES: LDAP authentication
Previous Message Emi Lu 2006-05-26 14:30:19 Re: delete is extremely slow