+ /**
+ * Generates a link to the given Title
+ *
+ * @note This is only public for technical reasons. It's not intended for use outside Linker.
+ *
+ * @param Title $title
+ * @param string $text
+ * @param string|null $wikiId Id of the wiki to link to (if not the local wiki), as used by WikiMap.
+ * @param string|string[] $options See the $options parameter in Linker::link.
+ *
+ * @return string HTML link
+ */
+ public static function makeCommentLink( Title $title, $text, $wikiId = null, $options = array() ) {
+ if ( $wikiId !== null && !$title->isExternal() ) {
+ $link = Linker::makeExternalLink(
+ WikiMap::getForeignURL( $wikiId, $title->getPrefixedText(), $title->getFragment() ),
+ $text,
+ /* escape = */ false // Already escaped
+ );
+ } else {
+ $link = Linker::link( $title, $text, array(), array(), $options );
+ }
+
+ return $link;
+ }
+