示例#1
0
 public static function init()
 {
     // remove magic_quotes
     if (get_magic_quotes_gpc()) {
         function undo_magic_quotes_array($array)
         {
             $arr = array();
             foreach ($array as $ind => $val) {
                 if (!is_array($val) && !is_object($val)) {
                     $val = stripslashes($val);
                 }
                 $arr[$ind] = $val;
             }
             return $arr;
         }
         $_GET = undo_magic_quotes_array($_GET);
         $_POST = undo_magic_quotes_array($_POST);
         $_COOKIE = undo_magic_quotes_array($_COOKIE);
     }
     function bt_trim_whitepsace(&$var)
     {
         $var = trim($var);
     }
     array_walk_recursive($_GET, 'bt_trim_whitepsace');
     array_walk_recursive($_POST, 'bt_trim_whitepsace');
     self::$_logger = new BTLogger('syslog');
 }