Re: PHP HTML text editor issues...
| From: | Justin Patrin | Date: | Wed, 18 Aug 2004 17:39:16 +0000 |
| Subject: | Re: PHP HTML text editor issues... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-194175@lists.php.net to get a copy of this message | ||
On Wed, 18 Aug 2004 17:17:26 +0000, Curt Zirzow
<php-general@zirzow.dyndns.org> wrote:
> * Thus wrote Tim Traver:
> > Hi all,
> >
> > ok, I've made my own version of a file manager complete with a text editor,
> > and I'm having troubles figuring out some issues.
> > ...
> >
> > I've tried to use addslashes and stripslashes to prevent some of the
> > clobbering of the text, but it doesn't seem to be working. If I don't do
> > anything, it looks like PHP (or HTML) backslashes all quotes...
> >
> > I just want to get the EXACT text that is in the textarea to be saved to
> > disk...
> >
> > Here is an example of a line that gets clobbered :
> >
> > $value =~ tr/\0//d;
> >
> > I read the file in from disk using file_get_contents. Does that do any
> > translation ???
>
> file_get_contents doesn't do any filtering. The issue your you're
> probably running into is that magic_quotes_gpc is set to On. This
> will addslashes to all your data by default. Two options:
>
> 1. Turn it off.
> 2. apply strip_slashes() to the string before writing to disk
>
Don't you mean magic_quotes_runtime?
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--