Browse Source

undo magic quotes setting if present

pull/1/head
Friendika 11 years ago
parent
commit
81636f6f5f
1 changed files with 19 additions and 0 deletions
  1. +19
    -0
      boot.php

+ 19
- 0
boot.php View File

@ -94,6 +94,25 @@ define ( 'GRAVITY_PARENT', 0);
define ( 'GRAVITY_LIKE', 3);
define ( 'GRAVITY_COMMENT', 6);
// Please disable magic_quotes_gpc so we don't have to do this.
// See http://php.net/manual/en/security.magicquotes.disabling.php
if (get_magic_quotes_gpc()) {
$process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
while (list($key, $val) = each($process)) {
foreach ($val as $k => $v) {
unset($process[$key][$k]);
if (is_array($v)) {
$process[$key][stripslashes($k)] = $v;
$process[] = &$process[$key][stripslashes($k)];
} else {
$process[$key][stripslashes($k)] = stripslashes($v);
}
}
}
unset($process);
}
// Our main application structure for the life of this page
// Primarily deals with the URL that got us here


Loading…
Cancel
Save