if ( $title instanceof Title ) {
wfProfileIn( __METHOD__ );
$currentExists = $time ? ( wfFindFile( $title ) != false ) : false;
- if ( ( $wgUploadMissingFileUrl || $wgEnableUploads ) && !$currentExists ) {
- if ( $text == '' )
- $text = htmlspecialchars( $title->getPrefixedText() );
+ list( $inside, $trail ) = self::splitTrail( $trail );
+ if ( $text == '' )
+ $text = htmlspecialchars( $title->getPrefixedText() );
+
+ if ( ( $wgUploadMissingFileUrl || $wgEnableUploads ) && !$currentExists ) {
$redir = RepoGroup::singleton()->getLocalRepo()->checkRedirect( $title );
+
if ( $redir ) {
wfProfileOut( __METHOD__ );
- return $this->makeKnownLinkObj( $title, $text, $query, $trail, $prefix );
+ return $this->linkKnown( $title, "$prefix$text$inside", array(), $query ) . $trail;
}
$href = $this->getUploadUrl( $title, $query );
-
- list( $inside, $trail ) = self::splitTrail( $trail );
-
wfProfileOut( __METHOD__ );
return '<a href="' . htmlspecialchars( $href ) . '" class="new" title="' .
htmlspecialchars( $title->getPrefixedText(), ENT_QUOTES ) . '">' .
htmlspecialchars( $prefix . $text . $inside, ENT_NOQUOTES ) . '</a>' . $trail;
} else {
wfProfileOut( __METHOD__ );
- return $this->makeKnownLinkObj( $title, $text, $query, $trail, $prefix );
+ return $this->linkKnown( $title, "$prefix$text$inside", array(), $query ) . $trail;
}
} else {
return "<!-- ERROR -->{$prefix}{$text}{$trail}";
'hashLevels' => 2,
'transformVia404' => false,
),
- 'wgEnableUploads' => true,
+ 'wgEnableUploads' => self::getOptionValue( 'wgEnableUploads', $opts, true ),
'wgStyleSheetPath' => '/skins',
'wgSitename' => 'MediaWiki',
'wgServerName' => 'Britney-Spears',