r84263 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84262‎ | r84263 | r84264 >
Date:20:44, 18 March 2011
Author:mah
Status:ok (Comments)
Tags:
Comment:
Apply patch for Bug #27899 Special:NewPages does not handle RevisionDeletion

This means the hidden comment of a new created page is shown and the hidden
user of a new created page is also shown.

Patch supplied by Jarry1250
Modified paths:
  • /trunk/phase3/includes/specials/SpecialNewpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialNewpages.php
@@ -290,8 +290,17 @@
291291 public function formatRow( $result ) {
292292 global $wgLang, $wgContLang;
293293
 294+ # Revision deletion works on revisions, so we should cast one
 295+ $row = array(
 296+ 'comment' => $result->rc_comment,
 297+ 'deleted' => $result->rc_deleted,
 298+ 'user_text' => $result->rc_user_text,
 299+ 'user' => $result->rc_user,
 300+ );
 301+ $rev = new Revision( $row );
 302+
294303 $classes = array();
295 -
 304+
296305 $dm = $wgContLang->getDirMark();
297306
298307 $title = Title::makeTitleSafe( $result->rc_namespace, $result->rc_title );
@@ -324,10 +333,10 @@
325334 '[' . wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->length ) ) .
326335 ']'
327336 );
328 - $ulink = $this->skin->userLink( $result->rc_user, $result->rc_user_text ) . ' ' .
329 - $this->skin->userToolLinks( $result->rc_user, $result->rc_user_text );
330 - $comment = $this->skin->commentBlock( $result->rc_comment );
331 -
 337+
 338+ $ulink = $this->skin->revUserTools( $rev );
 339+ $comment = $this->skin->revComment( $rev );
 340+
332341 if ( $this->patrollable( $result ) ) {
333342 $classes[] = 'not-patrolled';
334343 }
@@ -507,7 +516,7 @@
508517 'fields' => array(
509518 'rc_namespace', 'rc_title', 'rc_cur_id', 'rc_user',
510519 'rc_user_text', 'rc_comment', 'rc_timestamp', 'rc_patrolled',
511 - 'rc_id', 'page_len AS length', 'page_latest AS rev_id',
 520+ 'rc_id', 'rc_deleted', 'page_len AS length', 'page_latest AS rev_id',
512521 'ts_tags'
513522 ),
514523 'conds' => $conds,

Comments

#Comment by Aaron Schulz (talk | contribs)   21:21, 17 June 2011

How did this get missed?

Status & tagging log