r80662 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80661‎ | r80662 | r80663 >
Date:23:53, 20 January 2011
Author:yaron
Status:deferred (Comments)
Tags:
Comment:
Added handlin for $egApprovedRevsBlankIfUnapproved to unsetIfUnapproved()
Modified paths:
  • /trunk/extensions/ApprovedRevs/ApprovedRevs_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ApprovedRevs/ApprovedRevs_body.php
@@ -172,12 +172,18 @@
173173 * extensions such as Semantic MediaWiki; and logs the action.
174174 */
175175 public static function unsetApproval( $title ) {
 176+ global $egApprovedRevsBlankIfUnapproved;
 177+
176178 self::deleteRevisionApproval( $title );
177179
178180 $parser = new Parser();
179181 $parser->setTitle( $title );
180 - $article = new Article( $title );
181 - $text = $article->getContent();
 182+ if ( $egApprovedRevsBlankIfUnapproved ) {
 183+ $text = '';
 184+ } else {
 185+ $article = new Article( $title );
 186+ $text = $article->getContent();
 187+ }
182188 $options = new ParserOptions();
183189 $parser->parse( $text, $title, $options );
184190 $u = new LinksUpdate( $title, $parser->getOutput() );

Comments

#Comment by Nikerabbit (talk | contribs)   07:37, 21 January 2011

Use

new Article( $title, 0 );

Status & tagging log