*
* @param array $query
* @param bool $query2
- * @param string $proto Protocol to use; setting this will cause a full URL to be used
+ * @param string|int|bool $proto A PROTO_* constant on how the URL should be expanded,
+ * or false (default) for no expansion
* @see self::getLocalURL for the arguments.
* @return string The URL
*/
- public function getLinkURL( $query = '', $query2 = false, $proto = PROTO_RELATIVE ) {
- if ( $this->isExternal() || $proto !== PROTO_RELATIVE ) {
+ public function getLinkURL( $query = '', $query2 = false, $proto = false ) {
+ if ( $this->isExternal() || $proto !== false ) {
$ret = $this->getFullURL( $query, $query2, $proto );
} elseif ( $this->getPrefixedText() === '' && $this->hasFragment() ) {
$ret = $this->getFragmentForURL();
private function getLinkURL( LinkTarget $target, array $query = [] ) {
// TODO: Use a LinkTargetResolver service instead of Title
$title = Title::newFromLinkTarget( $target );
- $proto = $this->expandUrls !== false
- ? $this->expandUrls
- : PROTO_RELATIVE;
if ( $this->forceArticlePath ) {
$realQuery = $query;
$query = [];
} else {
$realQuery = [];
}
- $url = $title->getLinkURL( $query, false, $proto );
+ $url = $title->getLinkURL( $query, false, $this->expandUrls );
if ( $this->forceArticlePath && $realQuery ) {
$url = wfAppendQuery( $url, $realQuery );
'target' => $this->list->title->getPrefixedText(),
'file' => $file->getKey(),
'token' => $user->getEditToken( $file->getKey() )
- ],
- false, PROTO_RELATIVE
+ ]
),
];
}
'target' => $this->list->title->getPrefixedText(),
'file' => $file->getArchiveName(),
'token' => $user->getEditToken( $file->getArchiveName() )
- ],
- false, PROTO_RELATIVE
+ ]
),
];
}