r68519 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68518‎ | r68519 | r68520 >
Date:15:30, 24 June 2010
Author:aaron
Status:ok
Tags:
Comment:
Removed $wgReviewCodes. Just use $wgSecretKey like WMF projects.
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -149,11 +149,6 @@
150150 # NOTE: The stable version precedence cannot be configured per page with this.
151151 $wgFlaggedRevsProtection = false;
152152
153 -# Please set these as something different. Any text will do, though it probably
154 -# shouldn't be very short (less secure) or very long (waste of resources).
155 -# There must be two codes, and only the first two are checked.
156 -$wgReviewCodes = array();
157 -
158153 # URL location for flaggedrevs.css and flaggedrevs.js
159154 # Use a literal $wgScriptPath as a placeholder for the runtime value of $wgScriptPath
160155 $wgFlaggedRevsStylePath = '$wgScriptPath/extensions/FlaggedRevs/client';
Index: trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php
@@ -596,7 +596,7 @@
597597 wfProfileOut( __METHOD__ );
598598 return true;
599599 }
600 -
 600+
601601 /**
602602 * Get a validation key from versioning metadata
603603 * @param string $tmpP
@@ -606,15 +606,10 @@
607607 * @return string
608608 */
609609 public static function validationKey( $tmpP, $imgP, $imgV, $rid ) {
610 - global $wgReviewCodes;
611 - # Fall back to $wgSecretKey/$wgProxyKey
612 - if ( empty( $wgReviewCodes ) ) {
613 - global $wgSecretKey, $wgProxyKey;
614 - $key = $wgSecretKey ? $wgSecretKey : $wgProxyKey;
615 - $p = md5( $key . $imgP . $tmpP . $rid . $imgV );
616 - } else {
617 - $p = md5( $wgReviewCodes[0] . $imgP . $rid . $tmpP . $imgV . $wgReviewCodes[1] );
618 - }
 610+ global $wgSecretKey, $wgProxyKey;
 611+ # Fall back to $wgProxyKey
 612+ $key = $wgSecretKey ? $wgSecretKey : $wgProxyKey;
 613+ $p = md5( $key . $imgP . $tmpP . $rid . $imgV );
619614 return $p;
620615 }
621616

Status & tagging log