Merge "ApiPageSet::initFromPageIds: Default $filterIds to true"
[lhc/web/wiklou.git] / includes / api / ApiFormatBase.php
index 18c36de..9d69145 100644 (file)
@@ -252,6 +252,7 @@ abstract class ApiFormatBase extends ApiBase {
                        $out = new OutputPage( $context );
                        $context->setOutput( $out );
 
+                       $out->setRobotPolicy( 'noindex,nofollow' );
                        $out->addModuleStyles( 'mediawiki.apipretty' );
                        $out->setPageTitle( $context->msg( 'api-format-title' ) );
 
@@ -298,7 +299,7 @@ abstract class ApiFormatBase extends ApiBase {
 
                        if ( $this->getIsWrappedHtml() ) {
                                // This is a special output mode mainly intended for ApiSandbox use
-                               $time = microtime( true ) - $this->getConfig()->get( 'RequestTime' );
+                               $time = $this->getMain()->getRequest()->getElapsedTime();
                                $json = FormatJson::encode(
                                        [
                                                'status' => (int)( $this->mHttpStatus ?: 200 ),
@@ -315,7 +316,7 @@ abstract class ApiFormatBase extends ApiBase {
                                        false, FormatJson::ALL_OK
                                );
 
-                               // T68776: wfMangleFlashPolicy() is needed to avoid a nasty bug in
+                               // T68776: OutputHandler::mangleFlashPolicy() avoids a nasty bug in
                                // Flash, but what it does isn't friendly for the API, so we need to
                                // work around it.
                                if ( preg_match( '/\<\s*cross-domain-policy\s*\>/i', $json ) ) {