Same name and namespace in other branches
  1. 4.7.x includes/common.inc \fix_gpc_magic()
  2. 5.x includes/common.inc \fix_gpc_magic()
  3. 6.x includes/common.inc \fix_gpc_magic()
  4. 7.x includes/common.inc \fix_gpc_magic()

Correct double-escaping problems caused by "magic quotes" in some PHP installations.

1 call to fix_gpc_magic()
index.php in ./index.php

File

includes/common.inc, line 403
Common functions that many Drupal modules will need to reference.

Code

function fix_gpc_magic() {
  static $fixed = false;
  if (!$fixed && ini_get('magic_quotes_gpc')) {
    array_walk($_GET, '_fix_gpc_magic');
    array_walk($_POST, '_fix_gpc_magic');
    array_walk($_COOKIE, '_fix_gpc_magic');
    array_walk($_REQUEST, '_fix_gpc_magic');
    $fixed = true;
  }
}