From 9dcbae6ede2d2fa57114d3af3ffd9a20d2a9c703 Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Fri, 17 Sep 2004 05:36:59 +0000 Subject: [PATCH] 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. --- includes/Title.php | 3 +++ 1 file changed, 3 insertions(+) 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 ); -- 2.20.1