copy args function

darcs-hash:20080619141107-84dde-a5e018fdac3f72eee13b3093fbd871299cda0739.gz
This commit is contained in:
Evan Prodromou 2008-06-19 10:11:07 -04:00
parent 08035caa5b
commit 0d8de282b2
3 changed files with 11 additions and 6 deletions

View File

@ -40,11 +40,7 @@ class Action { // lawsuit
}
function handle($argarray) {
$strip = get_magic_quotes_gpc();
$this->args = array();
foreach ($argarray as $k => $v) {
$this->args[$k] = ($strip) ? stripslashes($v) : $v;
}
$this->args =& common_copy_args($argarray);
}
function boolean($key, $def=false) {

View File

@ -95,7 +95,7 @@ function oid_get_user($openid_url) {
function oid_check_immediate($openid_url, $backto=NULL) {
if (!$backto) {
$action = $_REQUEST['action'];
$args = clone($_GET);
$args = common_copy_args($_GET);
unset($args['action']);
$backto = common_local_url($action, $args);
}

View File

@ -887,3 +887,12 @@ function common_config($main, $sub) {
global $config;
return $config[$main][$sub];
}
function common_copy_args($from) {
$to = array();
$strip = get_magic_quotes_gpc();
foreach ($from as $k => $v) {
$to[$k] = ($strip) ? stripslashes($v) : $v;
}
return $to;
}