turning magic quotes off in bitnami stack

165 views Asked by At

I have bitnami stack on EC2 instance, I want to turn off magic quotes, but in the php.ini I cant find the option to turn off. I have seen how to turn off magic quotes through code but if I do

echo 'Value for '.get_magic_quotes_gpc();

It only echoes Value for Any help in this regard

1

There are 1 answers

2
Nanne On BEST ANSWER

get_magic_quotes_gpc returns a boolean false if it is off. do something like this:

echo 'Value for '. (get_magic_quotes_gpc() ? "magic quotes is on" : "magic quotes is off");

As reply to your comment:

The manual clearly states:

Returns 0 if magic_quotes_gpc is off, 1 otherwise. Or always returns FALSE as of PHP 5.4.0.

so if you call that function you get either a true result (it is on) and print that it is on with above line of code or the other way around. It returns false for newer versions, because it is always off in those functions.

If you get the 'else', that means it returns a false condition, meaning it is of. I can't explain it more: if false, then off. simple as that :)