Ignore request values that are not strings.
An array action or username no longer causes a PHP error.
This commit is contained in:
@@ -111,6 +111,13 @@ class SubmitTest extends PageTestCase {
|
||||
$this->assertSame(array(), $this->queries('/^INSERT/'));
|
||||
}
|
||||
|
||||
public function testAnArrayActionIsIgnored(): void {
|
||||
$page = $this->post('/publish', array('action' => array('post')));
|
||||
$this->assertSame(200, $page['status']);
|
||||
$this->assertStringNotContainsString('Please review your submission.', $page['body']);
|
||||
$this->assertSame(array(), $this->queries('/^INSERT/'));
|
||||
}
|
||||
|
||||
public function testFieldsAreEscapedInTheForm(): void {
|
||||
$token = $this->csrfToken($this->get('/publish')['body']);
|
||||
$page = $this->post('/publish', $this->story(array('action' => 'preview', 'csrf_token' => $token, 'g-recaptcha-response' => 'pass',
|
||||
|
||||
Reference in New Issue
Block a user