what function replaced globalize() it was in vb3.0 i am upgrading a mod to 3.6.x but cant get around this.
this was the old function
Quote:
// ###################### Start globalize #######################
function globalize(&$var_array, $var_names)
{
global $_FILES;
// takes variables from a $_REQUEST, $_POST style array
// and makes them into global variables
foreach ($var_names AS $varname => $type)
{
if (is_numeric($varname)) // This handles the case where you send a variable in without giving its type, i..e. 'foo' => INT
{
$varname = $type;
$type = '';
}
if (isset($var_array["$varname"]) OR $type == 'INT' OR $type == 'FILE')
{
switch ($type)
{
// integer value - run intval() on data
case 'INT':
$var_array["$varname"] = intval($var_array["$varname"]);
break;
// html-safe string - trim and htmlspecialchars data
case 'STR_NOHTML':
$var_array["$varname"] = htmlspecialchars_uni(trim($var_array["$varname"]));
break;
// string - trim data
case 'STR':
$var_array["$varname"] = trim($var_array["$varname"]);
break;
// file - get data from $_FILES array
case 'FILE':
if (isset($_FILES["$varname"]))
{
$var_array["$varname"] = $_FILES["$varname"];
}
break;
// Do nothing, i.e. arrays, etc.
default:
}
$GLOBALS["$varname"] = &$var_array["$varname"];
}
}
}
|