From c73ca3c4465e477ca45ba06041186252e4284687 Mon Sep 17 00:00:00 2001 From: Ilmari Karonen Date: Wed, 10 Dec 2008 17:03:57 +0000 Subject: [PATCH] Seems r44406 would've broken the RC feed on secure.wikimedia org: fix by introducing a new config variable $wgRC2UDPScriptUrl (defaulting to $wgServer . $wgScript if not set). NOTE: Wikimedia's secure.php needs to be updated to use the new variable. It might be possible to retire the fixupSquidUrl() hack once this is done, though I'm not sure if anything else relies on it. --- RELEASE-NOTES | 3 +++ includes/DefaultSettings.php | 7 +++++++ includes/RecentChange.php | 11 ++++++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8e4589e08d..3817551236 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -70,6 +70,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN using $wgUsePrivateIPs. * (bug 11009) The null file (ie: /dev/null) can be configured with $wgNullFile. Useful for overriding if the normal file isn't accessible +* $wgRC2UDPScriptUrl can be used to set the prefix for URLs in the RC->IRC feed + where enabled. The default is $wgServer . $wgScript (used to effectively be + $wgInternalServer . $wgScript). === Migrated extensions === The following extensions are migrated into MediaWiki 1.14: diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 4510a912d4..0178f042a8 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2142,6 +2142,13 @@ $wgRC2UDPPrefix = ''; */ $wgRC2UDPInterwikiPrefix = false; +/** + * This prefix is prepended to each URL in the IRC feed. If left false, the prefix + * $wgServer . $wgScript is used by default. You should set this if your $wgServer + * or $wgScript might vary, e.g. if your wiki can be reached via both HTTP and HTTPS. + */ +$wgRC2UDPScriptUrl = false; + /** * Set to true to omit "bot" edits (by users with the bot permission) from the * UDP feed. diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 10834bacbf..c4f1c7e1df 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -590,7 +590,7 @@ class RecentChange protected function getIRCLine() { global $wgUseRCPatrol, $wgUseNPPatrol, $wgRC2UDPInterwikiPrefix, $wgLocalInterwiki, - $wgInternalServer, $wgScript; + $wgServer, $wgScript, $wgRC2UDPScriptUrl; // FIXME: Would be good to replace these 2 extract() calls with something more explicit // e.g. list ($rc_type, $rc_id) = array_values ($this->mAttribs); [or something like that] @@ -610,13 +610,18 @@ class RecentChange if( $rc_type == RC_LOG ) { $url = ''; } else { - // XXX: *HACK* this should use $wgServer, hacked for SSL madness --brion 2005-12-26 - $url = $wgInternalServer . $wgScript; + if( $wgRC2UDPScriptUrl !== false ) { + $url = $wgRC2UDPScriptUrl; + } else { + $url = $wgServer . $wgScript; + } + if( $rc_type == RC_NEW ) { $url .= "?oldid=$rc_this_oldid"; } else { $url .= "?diff=$rc_this_oldid&oldid=$rc_last_oldid"; } + if( $wgUseRCPatrol || ($rc_type == RC_NEW && $wgUseNPPatrol) ) { $url .= "&rcid=$rc_id"; } -- 2.20.1