r40323 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40322‎ | r40323 | r40324 >
Date:15:15, 2 September 2008
Author:demon
Status:old
Tags:
Comment:
Fully deprecate $wgProxyKey. Has been marked as deprecated since 1.4, but never seems to have been done. Sites with $wgProxyKey set will continue to use the setting (added a fallback in Setup). Fixes bugs 9258 and 12089.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/config/index.php (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/ProxyTools.php (modified) (history)
  • /trunk/phase3/includes/Setup.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBlockme.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ProxyTools.php
@@ -138,7 +138,7 @@
139139 function wfProxyCheck() {
140140 global $wgBlockOpenProxies, $wgProxyPorts, $wgProxyScriptPath;
141141 global $wgMemc, $wgProxyMemcExpiry;
142 - global $wgProxyKey;
 142+ global $wgSecretKey;
143143
144144 if ( !$wgBlockOpenProxies ) {
145145 return;
@@ -154,7 +154,7 @@
155155 # Fork the processes
156156 if ( !$skip ) {
157157 $title = SpecialPage::getTitleFor( 'Blockme' );
158 - $iphash = md5( $ip . $wgProxyKey );
 158+ $iphash = md5( $ip . $wgSecretKey );
159159 $url = $title->getFullURL( 'ip='.$iphash );
160160
161161 foreach ( $wgProxyPorts as $port ) {
Index: trunk/phase3/includes/User.php
@@ -1650,13 +1650,11 @@
16511651 * @private
16521652 */
16531653 function setToken( $token = false ) {
1654 - global $wgSecretKey, $wgProxyKey;
 1654+ global $wgSecretKey;
16551655 $this->load();
16561656 if ( !$token ) {
16571657 if ( $wgSecretKey ) {
16581658 $key = $wgSecretKey;
1659 - } elseif ( $wgProxyKey ) {
1660 - $key = $wgProxyKey;
16611659 } else {
16621660 $key = microtime();
16631661 }
Index: trunk/phase3/includes/Setup.php
@@ -150,6 +150,10 @@
151151 wfProfileOut( $fname.'-includes' );
152152 wfProfileIn( $fname.'-misc1' );
153153
 154+# Override SecretKey with ProxyKey if a site is using the old setting
 155+if ( isset( $wgProxyKey ) ) {
 156+ $wgSecretKey = $wgProxyKey;
 157+}
154158
155159 $wgIP = false; # Load on demand
156160 # Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1357,8 +1357,6 @@
13581358 $wgSecretKey = false;
13591359 /** big list of banned IP addresses, in the keys not the values */
13601360 $wgProxyList = array();
1361 -/** deprecated */
1362 -$wgProxyKey = false;
13631361
13641362 /** Number of accounts each IP address may create, 0 to disable.
13651363 * Requires memcached */
Index: trunk/phase3/includes/specials/SpecialBlockme.php
@@ -8,11 +8,11 @@
99 *
1010 */
1111 function wfSpecialBlockme() {
12 - global $wgRequest, $wgBlockOpenProxies, $wgOut, $wgProxyKey;
 12+ global $wgRequest, $wgBlockOpenProxies, $wgOut, $wgSecretKey;
1313
1414 $ip = wfGetIP();
1515
16 - if( !$wgBlockOpenProxies || $wgRequest->getText( 'ip' ) != md5( $ip . $wgProxyKey ) ) {
 16+ if( !$wgBlockOpenProxies || $wgRequest->getText( 'ip' ) != md5( $ip . $wgSecretKey ) ) {
1717 $wgOut->addWikiMsg( 'proxyblocker-disabled' );
1818 return;
1919 }
Index: trunk/phase3/config/index.php
@@ -1706,7 +1706,7 @@
17071707
17081708 \$wgLanguageCode = \"{$slconf['LanguageCode']}\";
17091709
1710 -\$wgProxyKey = \"$secretKey\";
 1710+\$wgSecretKey = \"$secretKey\";
17111711
17121712 ## Default skin: you can change the default skin. Use the internal symbolic
17131713 ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
Index: trunk/phase3/RELEASE-NOTES
@@ -46,6 +46,9 @@
4747 * $wgAllowExternalImagesFrom may now be an array of multiple strings.
4848 * Introduced $wgEnableImageWhitelist to toggle the on-wiki external image
4949 whitelist on or off.
 50+* $wgProxyKey has been fully deprecated (marked as such since 1.4, never
 51+ seems to have been completed). $wgSecretKey is the official documented
 52+ setting now.
5053
5154 === New features in 1.14 ===
5255

Follow-up revisions

RevisionCommit summaryAuthorDate
r40354Reverting r40323, as per comments on wikitech-l. Deprecated doesn't mean remo...tstarling02:28, 3 September 2008
r40355This part of r40323 is useful.tstarling02:32, 3 September 2008

Status & tagging log