r73067 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73066‎ | r73067 | r73068 >
Date:15:19, 15 September 2010
Author:catrope
Status:ok
Tags:
Comment:
VariablePage: Make it explicit that 10000=100*100 to make the algorithm more understandable. Also unquote "$foo", these quotes are unnecessary
Modified paths:
  • /trunk/extensions/VariablePage/VariablePage.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/VariablePage/VariablePage.body.php
@@ -17,10 +17,10 @@
1818 $referrer = $wgRequest->getHeader( 'referrer' );
1919
2020 $tracking = '?' . wfArrayToCGI( array(
21 - 'utm_source' => "$utm_source",
22 - 'utm_medium' => "$utm_medium",
23 - 'utm_campaign' => "$utm_campaign",
24 - 'referrer' => "$referrer"
 21+ 'utm_source' => $utm_source,
 22+ 'utm_medium' => $utm_medium,
 23+ 'utm_campaign' => $utm_campaign,
 24+ 'referrer' => $referrer
2525 ));
2626
2727 $url = $this->determinePage( $wgVariablePagePossibilities );
@@ -42,7 +42,7 @@
4343 *
4444 * We use a # larger than 100 to increase 'randomness'
4545 */
46 - $random_number = mt_rand( 0, 10000 );
 46+ $random_number = mt_rand( 0, 100*100 );
4747 $offset = 0;
4848
4949 foreach ( $page_possibilities as $url => $probability ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r73073Followup r73066, r73067. Also added a 'sanity check' to make sure configurat...awjrichards17:21, 15 September 2010

Status & tagging log