From 58d09d4d53976141ae32bd15d3b6a2a3b088cee7 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 10 Dec 2010 18:23:33 +0000 Subject: [PATCH] Fixes for r78201: * Per Reedy, add braces where needed * Revert one change that should not have been there --- includes/parser/Parser.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 8cac644bb6..cbe72047b3 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -649,8 +649,9 @@ class Parser { * @return User object */ function getUser() { - if( !is_null( $this->mUser ) ) + if ( !is_null( $this->mUser ) ) { return $this->mUser; + } return $this->mOptions->getUser(); } @@ -1875,7 +1876,7 @@ class Parser { if ( $ns == NS_CATEGORY ) { wfProfileIn( __METHOD__."-category" ); - $s = preg_replace( "/(\s*\n)+\s*$/D", '', $s ); # bug 87 + $s = rtrim( $s . "\n" ); # bug 87 if ( $wasblank ) { $sortkey = $this->getDefaultSort(); @@ -4983,10 +4984,12 @@ class Parser { * @return either a Revision object or null */ protected function getRevisionObject() { - if ( !is_null( $this->mRevisionObject ) ) + if ( !is_null( $this->mRevisionObject ) ) { return $this->mRevisionObject; - if ( is_null( $this->mRevisionId ) ) + } + if ( is_null( $this->mRevisionId ) ) { return null; + } $this->mRevisionObject = Revision::newFromId( $this->mRevisionId ); return $this->mRevisionObject; -- 2.20.1