From 38e3709cca0e042b1d7420e2d80e77b92db5ab59 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Fri, 18 Mar 2011 20:44:29 +0000 Subject: [PATCH] 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 --- includes/specials/SpecialNewpages.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index f6f6358a52..79c1af9de6 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -290,8 +290,17 @@ class SpecialNewpages extends IncludableSpecialPage { public function formatRow( $result ) { global $wgLang, $wgContLang; + # Revision deletion works on revisions, so we should cast one + $row = array( + 'comment' => $result->rc_comment, + 'deleted' => $result->rc_deleted, + 'user_text' => $result->rc_user_text, + 'user' => $result->rc_user, + ); + $rev = new Revision( $row ); + $classes = array(); - + $dm = $wgContLang->getDirMark(); $title = Title::makeTitleSafe( $result->rc_namespace, $result->rc_title ); @@ -324,10 +333,10 @@ class SpecialNewpages extends IncludableSpecialPage { '[' . wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->length ) ) . ']' ); - $ulink = $this->skin->userLink( $result->rc_user, $result->rc_user_text ) . ' ' . - $this->skin->userToolLinks( $result->rc_user, $result->rc_user_text ); - $comment = $this->skin->commentBlock( $result->rc_comment ); - + + $ulink = $this->skin->revUserTools( $rev ); + $comment = $this->skin->revComment( $rev ); + if ( $this->patrollable( $result ) ) { $classes[] = 'not-patrolled'; } @@ -507,7 +516,7 @@ class NewPagesPager extends ReverseChronologicalPager { 'fields' => array( 'rc_namespace', 'rc_title', 'rc_cur_id', 'rc_user', 'rc_user_text', 'rc_comment', 'rc_timestamp', 'rc_patrolled', - 'rc_id', 'page_len AS length', 'page_latest AS rev_id', + 'rc_id', 'rc_deleted', 'page_len AS length', 'page_latest AS rev_id', 'ts_tags' ), 'conds' => $conds, -- 2.20.1