From 4fb4ad91b4559743e2c70907a86960f1b62e5994 Mon Sep 17 00:00:00 2001 From: Jackmcbarn Date: Sat, 27 Sep 2014 23:52:19 -0400 Subject: [PATCH] Don't clobber revision size of 0 When a revision's size is 0, don't clobber it by changing it to null. This causes, among other things, moves of empty pages to not show a revision size. If we get to where the else used to be, either mSize is 0 (and doing nothing is correct), or mSize is already null, in which case this didn't do anything anyway. We know this because, above, we initialized it with $this->mSize = isset( $row['len'] ) ? intval( $row['len'] ) : null; Change-Id: I3d9b9163368c57b9a7906f6569119081b945d57e --- includes/Revision.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/includes/Revision.php b/includes/Revision.php index 28a825d051..5b39a41b20 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -678,13 +678,8 @@ class Revision implements IDBAccessObject { $this->mCurrent = false; // If we still have no length, see it we have the text to figure it out - if ( !$this->mSize ) { - if ( $this->mContent !== null ) { - $this->mSize = $this->mContent->getSize(); - } else { - #NOTE: this should never happen if we have either text or content object! - $this->mSize = null; - } + if ( !$this->mSize && $this->mContent !== null ) { + $this->mSize = $this->mContent->getSize(); } // Same for sha1 -- 2.20.1