From: Jackmcbarn Date: Sun, 28 Sep 2014 03:52:19 +0000 (-0400) Subject: Don't clobber revision size of 0 X-Git-Tag: 1.31.0-rc.0~13774^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=4fb4ad91b4559743e2c70907a86960f1b62e5994;p=lhc%2Fweb%2Fwiklou.git 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 --- 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