Call Linker methods statically
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 16 Sep 2011 19:35:14 +0000 (19:35 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 16 Sep 2011 19:35:14 +0000 (19:35 +0000)
includes/api/ApiParse.php
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryFilearchive.php
includes/api/ApiQueryImageInfo.php
includes/api/ApiQueryLogEvents.php
includes/api/ApiQueryProtectedTitles.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQueryRevisions.php
includes/api/ApiQueryUserContributions.php
includes/api/ApiQueryWatchlist.php

index d963f8c..395dd34 100644 (file)
@@ -216,7 +216,7 @@ class ApiParse extends ApiBase {
 
                if ( !is_null( $params['summary'] ) ) {
                        $result_array['parsedsummary'] = array();
-                       $result->setContent( $result_array['parsedsummary'], $wgUser->getSkin()->formatComment( $params['summary'], $titleObj ) );
+                       $result->setContent( $result_array['parsedsummary'], Linker::formatComment( $params['summary'], $titleObj ) );
                }
 
                if ( isset( $prop['langlinks'] ) ) {
index 98e5150..813d98c 100644 (file)
@@ -230,7 +230,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                        $title = Title::makeTitle( $row->ar_namespace, $row->ar_title );
 
                        if ( $fld_parsedcomment ) {
-                               $rev['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->ar_comment, $title );
+                               $rev['parsedcomment'] = Linker::formatComment( $row->ar_comment, $title );
                        }
                        if ( $fld_minor && $row->ar_minor_edit == 1 ) {
                                $rev['minor'] = '';
index e7fbee4..ae38632 100644 (file)
@@ -166,7 +166,7 @@ class ApiQueryFilearchive extends ApiQueryBase {
                        if ( $fld_description ) {
                                $file['description'] = $row->fa_description;
                                if ( isset( $prop['parseddescription'] ) ) {
-                                       $file['parseddescription'] = $wgUser->getSkin()->formatComment(
+                                       $file['parseddescription'] = Linker::formatComment(
                                                $row->fa_description, $title );
                                }
                        }
index 03e11b7..884ec48 100644 (file)
@@ -318,8 +318,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                                $vals['commenthidden'] = '';
                        } else {
                                if ( $pcomment ) {
-                                       global $wgUser;
-                                       $vals['parsedcomment'] = $wgUser->getSkin()->formatComment(
+                                       $vals['parsedcomment'] = Linker::formatComment(
                                                $file->getDescription(), $file->getTitle() );
                                }
                                if ( $comment ) {
index 4ecf3af..db75c8e 100644 (file)
@@ -323,8 +323,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
                                }
 
                                if ( $this->fld_parsedcomment ) {
-                                       global $wgUser;
-                                       $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->log_comment, $title );
+                                       $vals['parsedcomment'] = Linker::formatComment( $row->log_comment, $title );
                                }
                        }
                }
index 21ca648..9330d18 100644 (file)
@@ -112,8 +112,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
                                }
 
                                if ( isset( $prop['parsedcomment'] ) ) {
-                                       global $wgUser;
-                                       $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->pt_reason, $title );
+                                       $vals['parsedcomment'] = Linker::formatComment( $row->pt_reason, $title );
                                }
 
                                if ( isset( $prop['expiry'] ) ) {
index bcafb68..79012cc 100644 (file)
@@ -410,8 +410,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
                }
 
                if ( $this->fld_parsedcomment && isset( $row->rc_comment ) ) {
-                       global $wgUser;
-                       $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->rc_comment, $title );
+                       $vals['parsedcomment'] = Linker::formatComment( $row->rc_comment, $title );
                }
 
                if ( $this->fld_redirect ) {
index 0031a52..5298d39 100644 (file)
@@ -424,8 +424,7 @@ class ApiQueryRevisions extends ApiQueryBase {
                                }
 
                                if ( $this->fld_parsedcomment ) {
-                                       global $wgUser;
-                                       $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $comment, $title );
+                                       $vals['parsedcomment'] = Linker::formatComment( $comment, $title );
                                }
                        }
                }
index a620421..354dc29 100644 (file)
@@ -321,8 +321,7 @@ class ApiQueryContributions extends ApiQueryBase {
                                }
 
                                if ( $this->fld_parsedcomment ) {
-                                       global $wgUser;
-                                       $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->rev_comment, $title );
+                                       $vals['parsedcomment'] = Linker::formatComment( $row->rev_comment, $title );
                                }
                        }
                }
index f2d9f66..2e45fdf 100644 (file)
@@ -295,7 +295,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
                }
 
                if ( $this->fld_parsedcomment && isset( $row->rc_comment ) ) {
-                       $vals['parsedcomment'] = $this->getSkin()->formatComment( $row->rc_comment, $title );
+                       $vals['parsedcomment'] = Linker::formatComment( $row->rc_comment, $title );
                }
 
                if ( $this->fld_loginfo && $row->rc_type == RC_LOG ) {