From: River Tarnell Date: Fri, 17 Sep 2004 05:36:59 +0000 (+0000) Subject: Patch from Wil Mahan to fix a bug where moving a page X-Git-Tag: 1.5.0alpha1~1994 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=9dcbae6ede2d2fa57114d3af3ffd9a20d2a9c703;p=lhc%2Fweb%2Fwiklou.git Patch from Wil Mahan to fix a bug where moving a page left the redirect with cur_random=0, so any new page created in its place never appeared on Special:Randompage. Fix: calculate cur_random for redirect when moving page. --- diff --git a/includes/Title.php b/includes/Title.php index 35051844c6..40d2de7d9b 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1101,6 +1101,8 @@ class Title { $dbw =& wfGetDB( DB_MASTER ); $now = $dbw->timestamp(); $won = wfInvertTimestamp( wfTimestamp(TS_MW,$now) ); + wfSeedRandom(); + $rand = number_format( mt_rand() / mt_getrandmax(), 12, '.', '' ); # Rename cur entry $dbw->updateArray( 'cur', @@ -1127,6 +1129,7 @@ class Title { 'inverse_timestamp' => $won, 'cur_touched' => $now, 'cur_is_redirect' => 1, + 'cur_random' => $rand, 'cur_is_new' => 1, 'cur_text' => "#REDIRECT [[" . $nt->getPrefixedText() . "]]\n" ), $fname );