From: jenkins-bot Date: Wed, 13 Sep 2017 10:15:54 +0000 (+0000) Subject: Merge "Linker: Accept LinkTargets in makeCommentLink()" X-Git-Tag: 1.31.0-rc.0~2124 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=f1c7c0f03da1607dc955dc8db879a16fc0575657;hp=62a9ee2f45e43d3a5dc3564334c210fa1e3ad298;p=lhc%2Fweb%2Fwiklou.git Merge "Linker: Accept LinkTargets in makeCommentLink()" --- diff --git a/includes/Linker.php b/includes/Linker.php index 1ba621a3a4..c24ae417f1 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1319,7 +1319,7 @@ class Linker { * * @note This is only public for technical reasons. It's not intended for use outside Linker. * - * @param Title $title + * @param LinkTarget $linkTarget * @param string $text * @param string|null $wikiId Id of the wiki to link to (if not the local wiki), * as used by WikiMap. @@ -1328,23 +1328,23 @@ class Linker { * @return string HTML link */ public static function makeCommentLink( - Title $title, $text, $wikiId = null, $options = [] + LinkTarget $linkTarget, $text, $wikiId = null, $options = [] ) { - if ( $wikiId !== null && !$title->isExternal() ) { + if ( $wikiId !== null && !$linkTarget->isExternal() ) { $link = self::makeExternalLink( WikiMap::getForeignURL( $wikiId, - $title->getNamespace() === 0 - ? $title->getDBkey() - : MWNamespace::getCanonicalName( $title->getNamespace() ) . ':' - . $title->getDBkey(), - $title->getFragment() + $linkTarget->getNamespace() === 0 + ? $linkTarget->getDBkey() + : MWNamespace::getCanonicalName( $linkTarget->getNamespace() ) . ':' + . $linkTarget->getDBkey(), + $linkTarget->getFragment() ), $text, /* escape = */ false // Already escaped ); } else { - $link = self::link( $title, $text, [], [], $options ); + $link = self::link( $linkTarget, $text, [], [], $options ); } return $link;