Re: DB quoteSmart + mysql + magic quotes
| From: | Justin Patrin | Date: | Sat, 07 Jan 2006 02:43:51 +0000 |
| Subject: | Re: DB quoteSmart + mysql + magic quotes | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-22470@lists.php.net to get a copy of this message | ||
On 1/6/06, Mark Steudel <mark@netriver.net> wrote:
> If Im using QF do I need to do a trim at the end or something to strip
> slashes? I know I've run into problems using QF where the slashes just grow
> and I had to apply stripslashes.
As long as you use QF's functions to get the values it will remove the
slahes for you. If you directly access $_REQUEST, $_POST, or $_GET
you're obviously going to get unfiltered data. I suggest using
exportValue() or exportValues().
Again, a better solution is to just turn off magic_quotes.
>
> -----Original Message-----
> From: Justin Patrin [mailto:papercrane@gmail.com]
> Sent: Friday, January 06, 2006 4:21 PM
> To: Mark Steudel
> Cc: pear-general@lists.php.net
> Subject: Re: [PEAR] DB quoteSmart + mysql + magic quotes
>
> On 1/6/06, Mark Steudel <mark@netriver.net> wrote:
> > If I am using db->quoteSmart( $val ) do I need to first strip slashes
> > on it before passing it into quoteSmart or does quoteSmart already
> > strip out slashes before running it's quote routine on it?
> >
>
> Use HTML_QuickForm, which will strip slashes if you have magic quotes on.
>
> And turn off magic quotes whenever you can. It's not useful.
>
> http://pear.reversefold.com/dokuwiki/doku.php?id=phpfaqs#why_is_magic_quotes
> _gpc_bad
>
> --
> Justin Patrin
>
> --
> PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Justin Patrin