From 6b239b04163032854813b773fd4372501f868d8d Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 7 Feb 2012 22:22:27 +0000 Subject: [PATCH] Made LogEntry::getPerformer() not fail miserable if we got the LogEntry via newFromRow() on just a logging table row. Previously, the current user IP would show. --- includes/logging/LogEntry.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php index 9d94325fba..6fe7539d99 100644 --- a/includes/logging/LogEntry.php +++ b/includes/logging/LogEntry.php @@ -217,9 +217,13 @@ class DatabaseLogEntry extends LogEntryBase { public function getPerformer() { $userId = (int) $this->row->log_user; - if ( $userId !== 0 ) { - return User::newFromRow( $this->row ); - } else { + if ( $userId !== 0 ) { // logged-in users + if ( isset( $this->row->user_name ) ) { + return User::newFromRow( $this->row ); + } else { + return User::newFromId( $userId ); + } + } else { // IP users $userText = $this->row->log_user_text; return User::newFromName( $userText, false ); } -- 2.20.1