Merge "Add maintenance/view.php for viewing page contents"
[lhc/web/wiklou.git] / includes / specials / SpecialWhatlinkshere.php
index 3349854..439b6ab 100644 (file)
@@ -378,11 +378,15 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
 
                $linkRenderer = $this->getLinkRenderer();
 
+               if ( $text !== null ) {
+                       $text = new HtmlArmor( $text );
+               }
+
                // always show a "<- Links" link
                $links = [
                        'links' => $linkRenderer->makeKnownLink(
                                $title,
-                               new HtmlArmor( $text ),
+                               $text,
                                [],
                                [ 'target' => $target->getPrefixedText() ]
                        ),
@@ -395,9 +399,13 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                        // check, if the content model is editable through action=edit
                        ContentHandler::getForTitle( $target )->supportsDirectEditing()
                ) {
+                       if ( $editText !== null ) {
+                               $editText = new HtmlArmor( $editText );
+                       }
+
                        $links['edit'] = $linkRenderer->makeKnownLink(
                                $target,
-                               new HtmlArmor( $editText ),
+                               $editText,
                                [],
                                [ 'action' => 'edit' ]
                        );
@@ -408,9 +416,13 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
        }
 
        function makeSelfLink( $text, $query ) {
+               if ( $text !== null ) {
+                       $text = new HtmlArmor( $text );
+               }
+
                return $this->getLinkRenderer()->makeKnownLink(
                        $this->selfTitle,
-                       new HtmlArmor( $text ),
+                       $text,
                        [],
                        $query
                );