Skip to content

Commit

Permalink
Fix magic_quotes_gpc related bug. Reported by Alex Baturin.
Browse files Browse the repository at this point in the history
This parameter is not settable from script + it affects parse_str that brakes redirect.php
  • Loading branch information
ioguix committed May 15, 2010
1 parent 674eac9 commit 1507915
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion libraries/lib.inc.php
Expand Up @@ -69,7 +69,6 @@
$misc->setForm();

// Enforce PHP environment
ini_set('magic_quotes_gpc', 0);
ini_set('magic_quotes_runtime', 0);
ini_set('magic_quotes_sybase', 0);
ini_set('arg_separator.output', '&');
Expand Down
5 changes: 5 additions & 0 deletions redirect.php
Expand Up @@ -14,6 +14,11 @@
parse_str(value(url($url['url'], $url['urlvars']), $_REQUEST), $vars);
array_shift($vars);

/* parse_str function is affected by magic_quotes_gpc */
if (ini_get('magic_quotes_gpc')) {
$misc->stripVar($vars);
}

$_REQUEST = array_merge($_REQUEST, $vars);
$_GET = array_merge($_GET, $vars);
}
Expand Down

0 comments on commit 1507915

Please sign in to comment.