Added additional backslashes in PHP

My crappy web host made some updates the other day, and some settings were shaken, because looking at our wiki page (MediaWiki), every quote is reset using backslashes. This is not even the data that is published (for example, articles) that are affected, but also the standard text of MediaWiki. eg:

You have followed a link to a page that does not yet exist. To create a page, start typing in the box below (see the help page for more information). If you are here by mistake, just click the browser button \\ '\' \ 'back \' \ '\'.

The first thing I did was disable magic_quotes_gpcAND magic_quotes_runtimewith a file .htaccess, but this is still happening. My php_info()reports this:

Setting             Local Value   Master Value  
magic_quotes_gpc        Off            On  
magic_quotes_runtime    Off            On  
magic_quotes_sybase     Off            Off  

Any ideas?

+5
source share
6 answers

If the PHP flags are set with php_admin_flag/ php_admin_value, you cannot change it from a file .htaccess. It caused me a headache earlier. Either turn it off php.ini, or cancel the magic quotes at runtime: http://talks.php.net/show/php-best-practices/26

+1
source

, . (), , , magic_quotes , .

+4

. , magic_quotes_gpc() . ( , /, )

if (ini_get('magic_quotes_gpc') ) {
  foreach($_GET as $key=>$value) {
    $_GET[$key] = stripslashes($value);
  } 
} // etc...
+1

, - set_magic_quotes_runtime().

0

crappy ? , , , .

-1

All Articles