logged in (anonpreviewwarning).
* (bug 22935) image/x-ms-bmp mime type added for BMP files
* (bug 23024) Special:ListFiles now escapes file names correctly
+* (bug 22867) "View source" tab is now only displayed if there's source text
=== API changes in 1.17 ===
* (bug 22738) Allow filtering by action type on query=logevent
);
}
}
- } elseif ( $this->mTitle->isKnown() ) {
+ } elseif ( $this->mTitle->hasSourceText() ) {
$content_actions['viewsource'] = array(
'class' => ($action == 'edit') ? 'selected' : false,
'text' => wfMsg( 'viewsource' ),
// If the page is form Mediawiki:message/lang, calling wfMsgWeirdKey causes
// the full l10n of that language to be loaded. That takes much memory and
// isn't needed. So we strip the language part away.
- // Also, extension messages which are not loaded, are shown as red, because
- // we don't call MessageCache::loadAllMessages.
list( $basename, /* rest */ ) = explode( '/', $this->mDbkeyform, 2 );
return wfMsgWeirdKey( $basename ); // known system message
default:
return $this->exists() || $this->isAlwaysKnown();
}
+ /**
+ * Does this page have source text?
+ *
+ * @return Boolean
+ */
+ public function hasSourceText() {
+ if ( $this->exists() )
+ return true;
+
+ if ( $this->mNamespace == NS_MEDIAWIKI ) {
+ // If the page is form Mediawiki:message/lang, calling wfMsgWeirdKey causes
+ // the full l10n of that language to be loaded. That takes much memory and
+ // isn't needed. So we strip the language part away.
+ list( $basename, /* rest */ ) = explode( '/', $this->mDbkeyform, 2 );
+ return wfMsgWeirdKey( $basename ); // known system message
+ }
+
+ return false;
+ }
+
/**
* Is this in a namespace that allows actual pages?
*
);
}
}
- // Checks if the page is known (some kind of viewable content)
- } elseif ( $this->mTitle->isKnown() ) {
+ // Checks if the page has some kind of viewable content
+ } elseif ( $this->mTitle->hasSourceText() ) {
// Adds view source view link
$links['views']['viewsource'] = array(
'class' => ( $action == 'edit' ) ? 'selected' : false,