I love PHP because its always simpler than you might expect ...
PHP Code:
<?php
if(!function_exists('glob')){
function glob($pattern){
//write your own glob routine here//
}
}
?>
does not cause the errors you may at first expect!
the recursive cleaner I use... (GPC_ON is set in config if the server has magic_quotes runtime or GPC turned on)
PHP Code:
<?php
function clean(&$arr){
foreach($arr as $k=>$v){
if(!is_array($v)){
if(defined('GPC_ON')){
$arr[$k]=stripslashes($v);
}
$arr[$k]=mysql_real_escape_string($v);
}else{
clean($arr[$k]);
}
}
}
clean($_POST);
?>