コード例 #1
0
 public function testPostWithinMockedEnvironment()
 {
     $posted = RequestWrapper::getPost('post_post_field', 'Bob');
     $this->assertEquals('Bob', $posted);
     $default = RequestWrapper::getPost('blah_doesnt_exist', 7777);
     $this->assertEquals(7777, $default);
 }
コード例 #2
0
ファイル: lib_input.php プロジェクト: NinjaWars/ninjawars
/**
 *  Wrapper around the post variables as a clean way to get input.
 */
function post($key, $default_val = null)
{
    $post = RequestWrapper::getPost($key);
    return isset($post) ? $post : $default_val;
}
コード例 #3
0
 public function postSelfUse()
 {
     $act = RequestWrapper::getPost('act');
     $url = 'skill/self_use/' . rawurlencode($act) . '/';
     // TODO: Need to double check that this doesn't allow for redirect injection
     return new RedirectResponse(WEB_ROOT . $url);
 }