Re: PHP HTML text editor issues...
| From: | Curt Zirzow | Date: | Wed, 18 Aug 2004 17:17:26 +0000 |
| Subject: | Re: PHP HTML text editor issues... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-194169@lists.php.net to get a copy of this message | ||
* 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
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!