default value. Depending on the type of the default value, * arguments will be typecast accordingly. For example, if * 'flag' => false is passed, all arguments for that will be cast to * boolean. Do *not* pass null, as it will not be recognized. * @param $aliases * */ function htmlpurifier_parse_args(&$AC, $aliases) { if (empty($_GET)) { array_shift($_SERVER['argv']); foreach ($_SERVER['argv'] as $opt) { if (strpos($opt, "=") !== false) { list($o, $v) = explode("=", $opt, 2); } else { $o = $opt; $v = true; } $o = ltrim($o, '-'); htmlpurifier_args($AC, $aliases, $o, $v); } } else { foreach ($_GET as $o => $v) { if (get_magic_quotes_gpc()) $v = stripslashes($v); htmlpurifier_args($AC, $aliases, $o, $v); } } } /** * Actually performs assignment to $AC, see htmlpurifier_parse_args() * @param $AC Arguments array to write to * @param $aliases Aliases for options * @param $o Argument name * @param $v Argument value */ function htmlpurifier_args(&$AC, $aliases, $o, $v) { if (isset($aliases[$o])) $o = $aliases[$o]; if (!isset($AC[$o])) return; if (is_string($AC[$o])) $AC[$o] = $v; if (is_bool($AC[$o])) $AC[$o] = true; }