Skip to content

Commit

Permalink
magic_quotes_gpc allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Apr 4, 2014
1 parent cda857b commit c13491f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jobs.common.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
'default'
);

handle_magic_quotes();

// Include init script -- this script is expected to take care of security
// checks and environment initialization for the rest of execution.
foreach ($identifiers as $identifier) {
Expand Down
22 changes: 22 additions & 0 deletions jobs.functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,3 +634,25 @@ function nsm_hash($conf) {
hash_update_file($hash_ctx, 'php://input');
return hash_final($hash_ctx);
}

function handle_magic_quotes() {
if (function_exists('get_magic_quotes_gpc')) {
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);
}
}
}

0 comments on commit c13491f

Please sign in to comment.