jenkins-bot has submitted this change and it was merged.

Change subject: Call Linker::link statically (1.18)
......................................................................


Call Linker::link statically (1.18)

Change-Id: I9cc16bda8f3db46ccfecbcab094adc9ff5af94f4
---
M SpecialReplaceText.php
1 file changed, 8 insertions(+), 11 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/SpecialReplaceText.php b/SpecialReplaceText.php
index 50b884d..34c9432 100644
--- a/SpecialReplaceText.php
+++ b/SpecialReplaceText.php
@@ -44,8 +44,6 @@
                $out = $this->getOutput();
                $request = $this->getRequest();
 
-               $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new 
Linker;
-
                $this->target = $request->getText( 'target' );
                $this->replacement = $request->getText( 'replacement' );
                $this->use_regex = $request->getBool( 'use_regex' );
@@ -105,7 +103,7 @@
 
                        // Link back
                        $out->addHTML(
-                               $linker->link( $this->getTitle(),
+                               Linker::link( $this->getTitle(),
                                        $this->msg( 'replacetext_return' 
)->escaped() )
                        );
 
@@ -188,7 +186,7 @@
                                }
 
                                if ( $bad_cat_name ) {
-                                       $link = $linker->link( $category_title, 
htmlspecialchars( ucfirst( $this->category ) ) );
+                                       $link = Linker::link( $category_title, 
htmlspecialchars( ucfirst( $this->category ) ) );
                                        $out->addHTML(
                                                $this->msg( 
'replacetext_nosuchcategory' )->rawParams( $link )->escaped()
                                        );
@@ -202,7 +200,7 @@
                                        }
                                }
                                // link back to starting form
-                               $out->addHTML( '<p>' . $linker->link( 
$this->getTitle(), $this->msg( 'replacetext_return' )->escaped() ) . '</p>' );
+                               $out->addHTML( '<p>' . Linker::link( 
$this->getTitle(), $this->msg( 'replacetext_return' )->escaped() ) . '</p>' );
                        } else {
                                // Show a warning message if the replacement
                                // string is either blank or found elsewhere on
@@ -298,7 +296,7 @@
                $tables = $this->namespaceTables( $namespaces );
                $out->addHTML(
                        "<div class=\"mw-search-formheader\"></div>\n" .
-                       "<fieldset id=\"mw-searchoptions\">\n" . 
+                       "<fieldset id=\"mw-searchoptions\">\n" .
                        Xml::tags( 'h4', null, $this->msg( 'powersearch-ns' 
)->parse() )
                );
                // The ability to select/unselect groups of namespaces in the
@@ -353,7 +351,7 @@
                $category_search_label = $this->msg( 
'replacetext_categorysearch' )->text();
                $prefix_search_label = $this->msg( 'replacetext_prefixsearch' 
)->text();
                $out->addHTML(
-                       "<fieldset id=\"mw-searchoptions\">\n" . 
+                       "<fieldset id=\"mw-searchoptions\">\n" .
                        Xml::tags( 'h4', null, $this->msg( 
'replacetext_optionalfilters' )->parse() ) .
                        Xml::element( 'div', array( 'class' => 'divider' ), '', 
false ) .
                        "<p>$category_search_label\n" .
@@ -417,7 +415,6 @@
                global $wgLang, $wgScriptPath;
 
                $out = $this->getOutput();
-               $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new 
Linker;
 
                $formOpts = array( 'id' => 'choose_pages', 'method' => 'post', 
'action' => $this->getTitle()->getFullUrl() );
                $out->addHTML(
@@ -441,7 +438,7 @@
                                list( $title, $context ) = $title_and_context;
                                $out->addHTML(
                                        Xml::check( $title->getArticleID(), 
true ) .
-                                       $linker->link( $title ) . " - 
<small>$context</small><br />\n"
+                                       Linker::link( $title ) . " - 
<small>$context</small><br />\n"
                                );
                        }
                        $out->addHTML( '<br />' );
@@ -452,7 +449,7 @@
                        foreach ( $titles_for_move as $title ) {
                                $out->addHTML(
                                        Xml::check( 'move-' . 
$title->getArticleID(), true ) .
-                                       $linker->link( $title ) . "<br />\n"
+                                       Linker::link( $title ) . "<br />\n"
                                );
                        }
                        $out->addHTML( '<br />' );
@@ -490,7 +487,7 @@
                        $out->addWikiMsg( 'replacetext_cannotmove', 
$wgLang->formatNum( count( $unmoveable_titles ) ) );
                        $text = "<ul>\n";
                        foreach ( $unmoveable_titles as $title ) {
-                               $text .= "<li>{$linker->link( $title )}<br 
/>\n";
+                               $text .= "<li>" . Linker::link( $title ) . "<br 
/>\n";
                        }
                        $text .= "</ul>\n";
                        $out->addHTML( $text );

-- 
To view, visit https://gerrit.wikimedia.org/r/106752
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9cc16bda8f3db46ccfecbcab094adc9ff5af94f4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ReplaceText
Gerrit-Branch: master
Gerrit-Owner: Siebrand <siebr...@wikimedia.org>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Yaron Koren <yaro...@gmail.com>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to