Beispiel #1
0
 function testCanApplyPriorFilter()
 {
     $filter = new T_Filter_NoMagicQuotes('mb_trim');
     $this->assertSame($filter->transform(' no\\\'Quote '), 'no\'Quote');
 }
Beispiel #2
0
 /**
  * Parse GET, POST, FILES and COOKIE inputs.
  *
  * @return array
  */
 protected function parseInput()
 {
     $get = $_GET;
     $post = $_POST;
     $cookie = $_COOKIE;
     if (get_magic_quotes_gpc()) {
         $f = new T_Filter_NoMagicQuotes();
         $get = $f->transform($get);
         $post = $f->transform($post);
         $cookie = $f->transform($cookie);
     }
     $data = array();
     $data['GET'] = new T_Cage_Array($get);
     $files = isset($_FILES) ? $_FILES : array();
     $data['POST'] = new T_Cage_Post($post, $files);
     $data['SERVER'] = new T_Cage_Array($_SERVER);
     $data['COOKIE'] = new T_Cage_Cookie($cookie);
     return $data;
 }