From feb45a7d93c52d940c69c2b6c0a5c887fe95c3a9 Mon Sep 17 00:00:00 2001 From: Ilmari Karonen Date: Wed, 10 Dec 2008 18:41:28 +0000 Subject: [PATCH] revert r44412 and part of r44406: keep the improved new page URLs, but use the old getInternalURL()/preg_replace() hack to generate them --- RELEASE-NOTES | 3 --- includes/DefaultSettings.php | 7 ------- includes/RecentChange.php | 21 ++++++++------------- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3817551236..8e4589e08d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -70,9 +70,6 @@ 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 0178f042a8..4510a912d4 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2142,13 +2142,6 @@ $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 c4f1c7e1df..276c259d04 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -589,8 +589,7 @@ class RecentChange } protected function getIRCLine() { - global $wgUseRCPatrol, $wgUseNPPatrol, $wgRC2UDPInterwikiPrefix, $wgLocalInterwiki, - $wgServer, $wgScript, $wgRC2UDPScriptUrl; + global $wgUseRCPatrol, $wgUseNPPatrol, $wgRC2UDPInterwikiPrefix, $wgLocalInterwiki; // 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] @@ -605,26 +604,22 @@ class RecentChange $title = $titleObj->getPrefixedText(); $title = self::cleanupForIRC( $title ); - // XXX: This used to call Title::getInternalURL() and then strip out the title, but that's - // a lot of complex code just to prepend two globals to a query string. Simplified. if( $rc_type == RC_LOG ) { $url = ''; } else { - if( $wgRC2UDPScriptUrl !== false ) { - $url = $wgRC2UDPScriptUrl; - } else { - $url = $wgServer . $wgScript; - } - if( $rc_type == RC_NEW ) { - $url .= "?oldid=$rc_this_oldid"; + $url = "oldid=$rc_this_oldid"; } else { - $url .= "?diff=$rc_this_oldid&oldid=$rc_last_oldid"; + $url = "diff=$rc_this_oldid&oldid=$rc_last_oldid"; } - if( $wgUseRCPatrol || ($rc_type == RC_NEW && $wgUseNPPatrol) ) { $url .= "&rcid=$rc_id"; } + // XXX: *HACK* this should use getFullURL(), hacked for SSL madness --brion 2005-12-26 + // XXX: *HACK^2* the preg_replace() undoes much of what getInternalURL() does, but we + // XXX: need to call it so that URL paths on the Wikimedia secure server can be fixed + // XXX: by a custom GetInternalURL hook --vyznev 2008-12-10 + $url = preg_replace( '/title=[^&]*&/', '', $titleObj->getInternalURL( $url ) ); } if( isset( $oldSize ) && isset( $newSize ) ) { -- 2.20.1