Recent Topics

remove_magic_quotes and multiple PHP.INI:magic_quotes_*

Started by on May 17, 2007 – Contents updated: May 17, 2007

May 17, 2007 10:44    

Hello All, :)

I ran into a strange problem tonight, and I figured I'd report it..

I attempted to make a post to my blog and was greeted with the parse error claiming my HTML was invalid. The HTML that it presented to me had escaped all of the quotes on the attributes within the html elements.

Code

<a href=\"/blah\">asdf</a> <!-- instead of the obvious -->

After a while of hunting the culprit down I came accross the following:

inc/_misc/_misc.funcs.php:1017

PHP

if( ini_get('magic_quotes_sybase'))

PHP

elseif( ini_get('magic_quotes_gpc'))

I'm guessing the system I'm being hosted on had just updated it's php.ini. I figure it was a side effect of updating the cPanel install, but the result ended up placing both magic_quotes_sybase and magic_quotes_gpc in the php.ini file.

PHP

magic_quotes_gpc "On"
magic_quotes_sybase "Off"

Not being a php fan, I had to look up the get_ini function to see what it did and saw that it returns the value of the option and not a boolean 'is enabled' type value. So, the fix was quick and easy,

PHP

if(!strcasecmp(ini_get('magic_quotes_sybase'),"on"))

PHP

elseif(!strcasecmp(ini_get('magic_quotes_gpc'),"on"))

So, with that I'm back running happily and enjoying my b2evo experience. :)

-niro

May 20, 2007 02:30

Thank you for reporting this niro.

This will be fixed in 1.10.1


Form is loading...

Build your own website! – This forum is powered by b2evolution CMS, a complete engine for your website.