* Removed deprecated $wgDisabledActions as it is hardly used anywhere.
* $wgRateLimitLog has been deprecated and replaced by
$wgDebugLogGroup['ratelimit'].
+* $wgLocalInterwikis is an array containing multiple local interwiki prefixes
+ (interwiki prefixes that point back to the current wiki). This effectively
+ allows more than one value of $wgLocalInterwiki to be specified and
+ understood by the parser. The value of $wgLocalInterwiki is automatically
+ prepended to the start of this array.
=== New features in 1.23 ===
* ResourceLoader can utilize the Web Storage API to cache modules client-side.
* SpecialRecentChanges no longer includes any functionality for generating feeds
- it has been factored out to ApiFeedRecentChanges. Old URLs redirect to new
ones.
+* RecentChange::mExtra['lang'] is no longer set and should no longer be used.
+ Extensions should read from other configuration variables, including
+ $wgLocalInterwikis, to identify the current wiki.
==== Removed classes ====
* FakeMemCachedClient (deprecated in 1.18)
/**
* The interwiki prefix of the current wiki, or false if it doesn't have one.
+ *
+ * @deprecated since 1.23; use $wgLocalInterwikis instead
*/
$wgLocalInterwiki = false;
+/**
+ * Array for multiple $wgLocalInterwiki values, in case there are several
+ * interwiki prefixes that point to the current wiki. If $wgLocalInterwiki is
+ * set, its value is prepended to this array, for backwards compatibility.
+ *
+ * Note, recent changes feeds use only the first entry in this array (or
+ * $wgLocalInterwiki, if it is set). See $wgRCFeeds
+ */
+$wgLocalInterwikis = array();
+
/**
* Expiry time for cache of interwiki table
*/
$wgRC2UDPPrefix = '';
/**
- * If this is set to true, $wgLocalInterwiki will be prepended to links in the
- * IRC feed. If this is set to a string, that string will be used as the prefix.
+ * If this is set to true, the first entry in the $wgLocalInterwikis array (or
+ * the value of $wgLocalInterwiki, if set) will be prepended to links in the IRC
+ * feed. If this is set to a string, that string will be used as the prefix.
*
* @deprecated since 1.22, use $wgRCFeeds
*/
* * 'omit_bots' -- whether the bot edits should be in the feed
* The IRC-specific options are:
* * 'add_interwiki_prefix' -- whether the titles should be prefixed with
- * $wgLocalInterwiki.
+ * the first entry in the $wgLocalInterwikis array (or the value of
+ * $wgLocalInterwiki, if set)
* The JSON-specific options are:
* * 'channel' -- if set, the 'channel' parameter is also set in JSON values.
*
- * To ensure backwards-compatability, whenever $wgRC2UDPAddress is set, a
+ * To ensure backwards-compatibility, whenever $wgRC2UDPAddress is set, a
* 'default' feed will be created reusing the deprecated $wgRC2UDP* variables.
*
* @example $wgRCFeeds['example'] = array(
$wgSkipSkins[] = $wgSkipSkin;
}
+if ( $wgLocalInterwiki ) {
+ array_unshift( $wgLocalInterwikis, $wgLocalInterwiki );
+}
+
# Set default shared prefix
if ( $wgSharedPrefix === false ) {
$wgSharedPrefix = $wgDBprefix;
* @return Bool true on success
*/
private function secureAndSplit() {
- global $wgContLang, $wgLocalInterwiki;
+ global $wgContLang, $wgLocalInterwikis;
# Initialisation
$this->mInterwiki = '';
$this->mInterwiki = $wgContLang->lc( $p );
# Redundant interwiki prefix to the local wiki
- if ( $wgLocalInterwiki !== false
- && 0 == strcasecmp( $this->mInterwiki, $wgLocalInterwiki )
- ) {
- if ( $dbkey == '' ) {
- # Can't have an empty self-link
- return false;
+ foreach ( $wgLocalInterwikis as $localIW ) {
+ if ( 0 == strcasecmp( $this->mInterwiki, $localIW ) ) {
+ if ( $dbkey == '' ) {
+ # Can't have an empty self-link
+ return false;
+ }
+ $this->mInterwiki = '';
+ $firstPass = false;
+ # Do another namespace split...
+ continue 2;
}
- $this->mInterwiki = '';
- $firstPass = false;
- # Do another namespace split...
- continue;
}
# If there's an initial colon after the interwiki, that also
* mExtra:
* prefixedDBkey prefixed db key, used by external app via msg queue
* lastTimestamp timestamp of previous entry, used in WHERE clause during update
- * lang the interwiki prefix, automatically set in save()
* oldSize text size before the change
* newSize text size after the change
* pageStatus status of the page: created, deleted, moved, restored, changed
* @param $noudp bool
*/
public function save( $noudp = false ) {
- global $wgLocalInterwiki, $wgPutIPinRC, $wgUseEnotif, $wgShowUpdatedMarker, $wgContLang;
+ global $wgPutIPinRC, $wgUseEnotif, $wgShowUpdatedMarker, $wgContLang;
$dbw = wfGetDB( DB_MASTER );
if ( !is_array( $this->mExtra ) ) {
$this->mExtra = array();
}
- $this->mExtra['lang'] = $wgLocalInterwiki;
if ( !$wgPutIPinRC ) {
$this->mAttribs['rc_ip'] = '';
* @see RCFeedFormatter::getLine
*/
public function getLine( array $feed, RecentChange $rc, $actionComment ) {
- global $wgUseRCPatrol, $wgUseNPPatrol, $wgLocalInterwiki,
+ global $wgUseRCPatrol, $wgUseNPPatrol, $wgLocalInterwikis,
$wgCanonicalServer, $wgScript;
$attribs = $rc->getAttributes();
if ( $attribs['rc_type'] == RC_LOG ) {
$flag .= ( $attribs['rc_type'] == RC_NEW ? "N" : "" ) . ( $attribs['rc_minor'] ? "M" : "" ) . ( $attribs['rc_bot'] ? "B" : "" );
}
- if ( $feed['add_interwiki_prefix'] === true && $wgLocalInterwiki !== false ) {
- $prefix = $wgLocalInterwiki;
+ if ( $feed['add_interwiki_prefix'] === true && $wgLocalInterwikis ) {
+ // we use the first entry in $wgLocalInterwikis in recent changes feeds
+ $prefix = $wgLocalInterwikis[0];
} elseif ( $feed['add_interwiki_prefix'] ) {
$prefix = $feed['add_interwiki_prefix'];
} else {
*/
public function testSecureAndSplit() {
$this->setMwGlobals( array(
- 'wgLocalInterwiki' => 'localtestiw',
+ 'wgLocalInterwikis' => array( 'localtestiw' ),
'wgHooks' => array(
'InterwikiLoadPrefix' => array(
function ( $prefix, &$data ) {