Magic Quotes - Problems with Inconsistent Behavior removing Slashes
| From: | Roy | Date: | Mon, 15 Jan 2001 23:51:07 +0000 |
| Subject: | Magic Quotes - Problems with Inconsistent Behavior removing Slashes | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-34715@lists.php.net to get a copy of this message | ||
I'm seeing strange behavior with Magic Quotes in PHP on my ISP hosted accounts. Basically, it's not consistently removing the escaped backslashes before displaying.
For instance, take the following piece database text (stored in, say, a character field)....
It's fun to be a penguin.
If I do a simple retrieve and echo on a webpage, I will get the following 80% of the time..
It's fun to be a penguin.
But, the other 20% of the time I get
It\'s fun to be a penguin.
There's something inconsistent about the way MagicQuotes are removed by the system...it's as if the system gets "busy" or the cache gets flushed before PHP gets the opportunity to unescape the single quotes.
Is anyone else seeing this behavior and has any suggestions on how to make it work more consistent? Yes, I've been including "stripslashes" to try to make SURE that these slashes get removed, but that doesn't work all the time EITHER.
Roy