From facfb655f76ec06a8a8bf571d9c43fb57650e1c8 Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Thu, 19 Aug 2004 12:59:57 +0000 Subject: [PATCH] fixup database timestamps --- includes/Article.php | 7 ++++--- includes/RecentChange.php | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index a00e5aa201..091083e17f 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -771,7 +771,7 @@ class Article { 'cur_text' => $text, 'cur_comment' => $summary, 'cur_user' => $wgUser->getID(), - 'cur_timestamp' => $now, + 'cur_timestamp' => $dbw->timestamp($now), 'cur_minor_edit' => $isminor, 'cur_counter' => 0, 'cur_restrictions' => '', @@ -779,7 +779,7 @@ class Article { 'cur_is_redirect' => $redir, 'cur_is_new' => 1, 'cur_random' => $rand, - 'cur_touched' => $now, + 'cur_touched' => $dbw->timestamp($now), 'inverse_timestamp' => $won, ), $fname ); @@ -799,7 +799,8 @@ class Article { # The talk page isn't in the regular link tables, so we need to update manually: $talkns = $ns ^ 1; # talk -> normal; normal -> talk - $dbw->updateArray( 'cur', array( 'cur_touched' => $now ), array( 'cur_namespace' => $talkns, 'cur_title' => $ttl ), $fname ); + $dbw->updateArray( 'cur', array('cur_touched' => $dbw->timestamp($now) ), + array( 'cur_namespace' => $talkns, 'cur_title' => $ttl ), $fname ); # standard deferred updates $this->editUpdates( $text ); diff --git a/includes/RecentChange.php b/includes/RecentChange.php index fbe1161e63..dfb5fe14f6 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -100,6 +100,10 @@ class RecentChange $this->mAttribs['rc_ip'] = ''; } + # Fixup database timestamps + $this->mAttribs['rc_timestamp']=$dbw->timestamp($this->mAttribs['rc_timestamp']); + $this->mAttribs['rc_cur_time']=$dbw->timestamp($this->mAttribs['rc_cur_time']); + # Insert new row $dbw->insertArray( "recentchanges", $this->mAttribs, $fname ); @@ -119,7 +123,7 @@ class RecentChange ), array( /* WHERE */ 'rc_namespace' => $ns, 'rc_title' => $title, - 'rc_timestamp' => $lastTime + 'rc_timestamp' => $dbw->timestamp($lastTime) ), $fname ); -- 2.20.1