From ec1b05892b6fd9fdb31d4f97a77234b7f863ecdc Mon Sep 17 00:00:00 2001 From: "This, that and the other" Date: Mon, 4 Jan 2016 00:55:35 +1100 Subject: [PATCH] Restore changes to WikiRevision that were lost in cdeba4cfc7c The commit cdeba4cfc7c unintentionally "reverted" part of commits 0623aeb922e and b14d581dab1. Change-Id: I19334bd6b871ab0555c6db873a67e935011aaaa4 --- includes/import/WikiRevision.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/includes/import/WikiRevision.php b/includes/import/WikiRevision.php index 6c238cf9f2..74766360ec 100644 --- a/includes/import/WikiRevision.php +++ b/includes/import/WikiRevision.php @@ -490,7 +490,7 @@ class WikiRevision { $prevId = $dbw->selectField( 'revision', 'rev_id', array( 'rev_page' => $pageId, - 'rev_timestamp <= ' . $dbw->timestamp( $this->timestamp ), + 'rev_timestamp <= ' . $dbw->addQuotes( $dbw->timestamp( $this->timestamp ) ), ), __METHOD__, array( 'ORDER BY' => array( @@ -534,6 +534,16 @@ class WikiRevision { function importLogItem() { $dbw = wfGetDB( DB_MASTER ); + + $user = User::newFromName( $this->getUser() ); + if ( $user ) { + $userId = intval( $user->getId() ); + $userText = $user->getName(); + } else { + $userId = 0; + $userText = $this->getUser(); + } + # @todo FIXME: This will not record autoblocks if ( !$this->getTitle() ) { wfDebug( __METHOD__ . ": skipping invalid {$this->type}/{$this->action} log time, timestamp " . @@ -566,8 +576,8 @@ class WikiRevision { 'log_type' => $this->type, 'log_action' => $this->action, 'log_timestamp' => $dbw->timestamp( $this->timestamp ), - 'log_user' => User::idFromName( $this->user_text ), - # 'log_user_text' => $this->user_text, + 'log_user' => $userId, + 'log_user_text' => $userText, 'log_namespace' => $this->getTitle()->getNamespace(), 'log_title' => $this->getTitle()->getDBkey(), 'log_comment' => $this->getComment(), -- 2.20.1