Merge "Avoid races on null revision insertion"
[lhc/web/wiklou.git] / includes / api / ApiParse.php
index fcab9be..5754c23 100644 (file)
@@ -427,9 +427,6 @@ class ApiParse extends ApiBase {
                }
 
                if ( isset( $prop['parsetree'] ) || $params['generatexml'] ) {
-                       if ( !isset( $prop['parsetree'] ) ) {
-                               $this->logFeatureUsage( 'action=parse&generatexml' );
-                       }
                        if ( $this->content->getModel() != CONTENT_MODEL_WIKITEXT ) {
                                $this->dieUsage( "parsetree is only supported for wikitext content", "notwikitext" );
                        }
@@ -637,7 +634,8 @@ class ApiParse extends ApiBase {
                foreach ( $links as $link => $sortkey ) {
                        $entry = array();
                        $entry['sortkey'] = $sortkey;
-                       ApiResult::setContentValue( $entry, 'category', $link );
+                       // array keys will cast numeric category names to ints, so cast back to string
+                       ApiResult::setContentValue( $entry, 'category', (string)$link );
                        if ( !isset( $hiddencats[$link] ) ) {
                                $entry['missing'] = true;
                        } elseif ( $hiddencats[$link] ) {
@@ -717,7 +715,6 @@ class ApiParse extends ApiBase {
 
        private function formatLimitReportData( $limitReportData ) {
                $result = array();
-               $apiResult = $this->getResult();
 
                foreach ( $limitReportData as $name => $value ) {
                        $entry = array();