revert r44412 and part of r44406: keep the improved new page URLs, but use the old...
authorIlmari Karonen <vyznev@users.mediawiki.org>
Wed, 10 Dec 2008 18:41:28 +0000 (18:41 +0000)
committerIlmari Karonen <vyznev@users.mediawiki.org>
Wed, 10 Dec 2008 18:41:28 +0000 (18:41 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/RecentChange.php

index 3817551..8e4589e 100644 (file)
@@ -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:
index 0178f04..4510a91 100644 (file)
@@ -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.
index c4f1c7e..276c259 100644 (file)
@@ -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 ) ) {