Jump to content

Magic Quotes GPC on & correctly display of quotes


baconbeastnz

Recommended Posts

Hi there, Ok basically I have to correctly display messages created by users, in an environment when GPC can be both on and off

 

My problem so far, is that when entering : hello "there" , this will output as : hello /"there/"

 

I cannot change the echo on the other, it has to be done before the data hits the array, here is what I've tried:

 

'text' => '".nl2br(htmlentities($_POST["NEWMESSTEXT"]))."'

 

The other end, is just echo($text);

 

Any help would be really appreciated, boss is on my ass lol

MM ok I already knew that.

 

I dont think I have illustrated my problem clearly enough..

 

stripslashes will work for things like: hey "there"

 

But I also need it to display slashes properly : e.g i enter : \\\\\ and it outputs : \\\\\ , not  : \\

 

in pseudo:

 

if(gpc enabled) {

stripslashes(text)

//This is fine for : hello "there", but not for : \\\\\ /////

 

} else {

htmlentities(text)

//This is fine for : hello "there", but not for : \\\\\ /////

 

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.