similarly to the category namespace.
* $wgEnableSorbs renamed to $wgDnsBlacklistUrls ($wgEnableSorbs kept for
backward compatibility)
-
+* $wgUploadNavigationUrl now also affects images inline images that do not
+ exist. In that case the URL will get (?|&)wpDestFile=<filename> appended to
+ it as appropriate.
+
=== New features in 1.16 ===
* Add CSS defintion of the 'wikitable' class to shared.css
* (bug 21826) Subsections of Special:Version now also have anchors
* (bug 19791) Add URL of file source as comment to thumbs (for ImageMagick)
* (bug 21946) Sorted wikitables do not properly handle minus signs
+* (bug 18885) Red links for media files do not support shared repositories
=== Bug fixes in 1.16 ===
* @return string
*/
public function makeBrokenImageLinkObj( $title, $text = '', $query = '', $trail = '', $prefix = '', $time = false ) {
- global $wgEnableUploads;
+ global $wgEnableUploads, $wgUploadNavigationUrl;
if( $title instanceof Title ) {
wfProfileIn( __METHOD__ );
$currentExists = $time ? ( wfFindFile( $title ) != false ) : false;
- if( $wgEnableUploads && !$currentExists ) {
- $upload = SpecialPage::getTitleFor( 'Upload' );
+ if( ( $wgUploadNavigationUrl || $wgEnableUploads ) && !$currentExists ) {
if( $text == '' )
$text = htmlspecialchars( $title->getPrefixedText() );
+
$redir = RepoGroup::singleton()->getLocalRepo()->checkRedirect( $title );
if( $redir ) {
+ wfProfileOut( __METHOD__ );
return $this->makeKnownLinkObj( $title, $text, $query, $trail, $prefix );
}
+
$q = 'wpDestFile=' . $title->getPartialUrl();
if( $query != '' )
$q .= '&' . $query;
+
+ if( $wgUploadNavigationUrl ) {
+ $href = wfAppendQuery( $wgUploadNavigationUrl, $q );
+ } else {
+ $upload = SpecialPage::getTitleFor( 'Upload' );
+ $href = $upload->getLocalUrl( $q );
+ }
+
list( $inside, $trail ) = self::splitTrail( $trail );
- $style = $this->getInternalLinkAttributesObj( $title, $text, 'new' );
+
wfProfileOut( __METHOD__ );
- return '<a href="' . $upload->escapeLocalUrl( $q ) . '"'
- . $style . '>' . $prefix . $text . $inside . '</a>' . $trail;
+ return Html::element( 'a', array(
+ 'href' => $href,
+ 'class' => 'new',
+ 'title' => $title->getPrefixedText()
+ ), $prefix . $text . $inside ) . $trail;
} else {
wfProfileOut( __METHOD__ );
return $this->makeKnownLinkObj( $title, $text, $query, $trail, $prefix );
$url = $img->getURL();
$class = 'internal';
} else {
- $upload = SpecialPage::getTitleFor( 'Upload' );
- $url = $upload->getLocalUrl( 'wpDestFile=' . urlencode( $title->getDBkey() ) );
- $class = 'new';
+ return $this->makeBrokenImageLinkObj( $title, $text, '', '', '', '', $time==true );
}
$alt = htmlspecialchars( $title->getText() );
if( $text == '' ) {