This is not really an upgrading issue, but this category fits the best:

Following funny behaviour is not a bug and "related to magic quotes" apparently (that quote was the solution the guys from php.net provided!):

Adding the following to your .htaccess file:

"AddHandler application/x-httpd-php .php"

parses all php files correctly regarding "slash-involved" functions like addslashes, mysql_real_escape_string etc.:

addslashes("O'Brien") results in "O\'Brien" (as it should be, right?)

Adding the 5 to the PHP handler to your .htaccess file :

"AddHandler application/x-httpd-php5 .htm .html .php"

results in 2 extra slashes.

addslashes("O'Brien") results in "O\\'Brien".

Someone told me: well, three slashes is safer than one. That might well be, but these extra slashes don't let themselves get removed by stripslashes!!

Another one told me: look at the magic quotes. Well, ALL magic quotes whatsoever are OFF (doublechecked phpinfo()).

I have searched the manual, the php.net bugreports, multiple forums (basically all over the Internet) for an explanation (or at least someone who experienced the same). No such luck.

    You might want to try a var_dump(get_magic_quotes_gpc()); as a sanity check to see if it's turned on or not. (Maybe it uses a different php.ini file?)

      Thanks for the quick reply. The var_dump returns and int(0). So they are off, right?

      Thanks,

      Cees

        Write a Reply...