Set redirlinks indexed tag name on list=backlinks
[lhc/web/wiklou.git] / includes / api / ApiFormatJson.php
index be0b58b..6c5ad38 100644 (file)
@@ -32,7 +32,7 @@ class ApiFormatJson extends ApiFormatBase {
 
        private $mIsRaw;
 
-       public function __construct( $main, $format ) {
+       public function __construct( ApiMain $main, $format ) {
                parent::__construct( $main, $format );
                $this->mIsRaw = ( $format === 'rawfm' );
        }
@@ -66,7 +66,9 @@ class ApiFormatJson extends ApiFormatBase {
                $callback = $params['callback'];
                if ( $callback !== null ) {
                        $callback = preg_replace( "/[^][.\\'\\\"_A-Za-z0-9]/", '', $callback );
-                       $this->printText( "$callback($json)" );
+                       # Prepend a comment to try to avoid attacks against content
+                       # sniffers, such as bug 68187.
+                       $this->printText( "/**/$callback($json)" );
                } else {
                        $this->printText( $json );
                }