removeRequestVars() 공개 정적인 메소드

Removes all variables from request except whitelisted ones.
public static removeRequestVars ( &$whitelist ) : void
리턴 void
예제 #1
0
 /**
  * Test for removeRequestVars
  *
  * @return void
  */
 public function testRemoveRequestVars()
 {
     $_REQUEST['foo'] = 'bar';
     $_REQUEST['allow'] = 'all';
     $_REQUEST['second'] = 1;
     $allow_list = array('allow', 'second');
     Sanitize::removeRequestVars($allow_list);
     $this->assertFalse(isset($_REQUEST['foo']));
     $this->assertFalse(isset($_REQUEST['second']));
     $this->assertTrue(isset($_REQUEST['allow']));
 }