r44412 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44411‎ | r44412 | r44413 >
Date:17:03, 10 December 2008
Author:vyznev
Status:reverted (Comments)
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/RecentChange.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/RecentChange.php
@@ -590,7 +590,7 @@
591591
592592 protected function getIRCLine() {
593593 global $wgUseRCPatrol, $wgUseNPPatrol, $wgRC2UDPInterwikiPrefix, $wgLocalInterwiki,
594 - $wgInternalServer, $wgScript;
 594+ $wgServer, $wgScript, $wgRC2UDPScriptUrl;
595595
596596 // FIXME: Would be good to replace these 2 extract() calls with something more explicit
597597 // e.g. list ($rc_type, $rc_id) = array_values ($this->mAttribs); [or something like that]
@@ -610,13 +610,18 @@
611611 if( $rc_type == RC_LOG ) {
612612 $url = '';
613613 } else {
614 - // XXX: *HACK* this should use $wgServer, hacked for SSL madness --brion 2005-12-26
615 - $url = $wgInternalServer . $wgScript;
 614+ if( $wgRC2UDPScriptUrl !== false ) {
 615+ $url = $wgRC2UDPScriptUrl;
 616+ } else {
 617+ $url = $wgServer . $wgScript;
 618+ }
 619+
616620 if( $rc_type == RC_NEW ) {
617621 $url .= "?oldid=$rc_this_oldid";
618622 } else {
619623 $url .= "?diff=$rc_this_oldid&oldid=$rc_last_oldid";
620624 }
 625+
621626 if( $wgUseRCPatrol || ($rc_type == RC_NEW && $wgUseNPPatrol) ) {
622627 $url .= "&rcid=$rc_id";
623628 }
Index: trunk/phase3/includes/DefaultSettings.php
@@ -2143,6 +2143,13 @@
21442144 $wgRC2UDPInterwikiPrefix = false;
21452145
21462146 /**
 2147+ * This prefix is prepended to each URL in the IRC feed. If left false, the prefix
 2148+ * $wgServer . $wgScript is used by default. You should set this if your $wgServer
 2149+ * or $wgScript might vary, e.g. if your wiki can be reached via both HTTP and HTTPS.
 2150+ */
 2151+$wgRC2UDPScriptUrl = false;
 2152+
 2153+/**
21472154 * Set to true to omit "bot" edits (by users with the bot permission) from the
21482155 * UDP feed.
21492156 */
Index: trunk/phase3/RELEASE-NOTES
@@ -70,6 +70,9 @@
7171 using $wgUsePrivateIPs.
7272 * (bug 11009) The null file (ie: /dev/null) can be configured with $wgNullFile.
7373 Useful for overriding if the normal file isn't accessible
 74+* $wgRC2UDPScriptUrl can be used to set the prefix for URLs in the RC->IRC feed
 75+ where enabled. The default is $wgServer . $wgScript (used to effectively be
 76+ $wgInternalServer . $wgScript).
7477
7578 === Migrated extensions ===
7679 The following extensions are migrated into MediaWiki 1.14:

Follow-up revisions

RevisionCommit summaryAuthorDate
r44414revert r44412 and part of r44406: keep the improved new page URLs, but use th...vyznev18:41, 10 December 2008
r94990Followup r94754: move protocol expansion from getIRCLine() to inside getInter...catrope08:56, 19 August 2011
r94995Per CR on r44412 and my promise in the commit summary of r94990, stop abusing...catrope11:23, 19 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r44406(bug 4253, bug 16586) Don't repeat titles of new pages in URLs in the RC->IRC...vyznev15:56, 10 December 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   18:13, 10 December 2008

$wgRC2UDPScriptUrl seems pretty .... weird. What we want is just a standard way to say "give me the canonical URL for this page / for the script URL which we can pass into general output". That should not be anything RC- or UDP-specific.

#Comment by Ilmari Karonen (talk | contribs)   18:44, 10 December 2008

Reverted back to the old getInternalURL()/preg_replace() method in r44414 -- it's ugly but it works. The long term solution might be to write a Title::getCanonicalFullURL() function, governed by a $wgCanonicalScriptUrl config variable.

Status & tagging log