Re: MDB2 autoExecute escaping data
| From: | Justin Patrin | Date: | Mon, 08 Oct 2007 03:48:04 +0000 |
| Subject: | Re: MDB2 autoExecute escaping data | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-28069@lists.php.net to get a copy of this message | ||
On 10/7/07, Christian Schmidt <pear.php.net@chsc.dk> wrote:
> Mark Steudel wrote:
> > I think I'm checking for that, here's the code I am running:
> >
> > // convert to html entities
> > $html = htmlentities( $_POST['content'], ENT_QUOTES );
> >
> > // check if magic quotes gpc is on, remove slashes
> > if( get_magic_quotes_gpc() )
> > {
> > $data = stripslashes( $html);
> > }
> Generally, you should call stripslashes() before anything else, i.e.
> before htmlentities().
>
Then again you really shouldn't be running htmlentities on data you're
insertinng into the DB in the first place.
--
Justin Patrin