X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fapi%2Fformat%2FApiFormatJsonTest.php;h=fc1f90217aac759a8e5b7e1de6aedc4c84e3a280;hb=0c615d9029cb6e0d65c21f1df5a8a54e197b860a;hp=c71faec8e2e740fc42b36d1730ebf073fc91fa68;hpb=c83d5d7864c299851e52c5098d45b9fff3ac0693;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/api/format/ApiFormatJsonTest.php b/tests/phpunit/includes/api/format/ApiFormatJsonTest.php index c71faec8e2..fc1f90217a 100644 --- a/tests/phpunit/includes/api/format/ApiFormatJsonTest.php +++ b/tests/phpunit/includes/api/format/ApiFormatJsonTest.php @@ -14,4 +14,9 @@ class ApiFormatJsonTest extends ApiFormatTestBase { $this->assertInternalType( 'array', json_decode( $data, true ) ); $this->assertGreaterThan( 0, count( (array)$data ) ); } + + public function testJsonpInjection( ) { + $data = $this->apiRequest( 'json', array( 'action' => 'query', 'meta' => 'siteinfo', 'callback' => 'myCallback' ) ); + $this->assertEquals( '/**/myCallback(', substr( $data, 0, 15 ) ); + } }