From: Alexandre Emsenhuber Date: Fri, 10 Dec 2010 18:23:33 +0000 (+0000) Subject: Fixes for r78201: X-Git-Tag: 1.31.0-rc.0~33385 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=58d09d4d53976141ae32bd15d3b6a2a3b088cee7;p=lhc%2Fweb%2Fwiklou.git Fixes for r78201: * Per Reedy, add braces where needed * Revert one change that should not have been there --- 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;