@@ -293,6 +293,19 @@ function () {
293293);
294294}
295295
296+ /**
297+ * @param stdClass $row Result row from recent changes
298+ * @return Revision|bool
299+ */
300+ protected function revisionFromRcResult ( stdClass $ result ) {
301+ return new Revision ( [
302+ 'comment ' => $ result ->rc_comment ,
303+ 'deleted ' => $ result ->rc_deleted ,
304+ 'user_text ' => $ result ->rc_user_text ,
305+ 'user ' => $ result ->rc_user ,
306+ ] );
307+ }
308+
296309/**
297310 * Format a row, providing the timestamp, links to the page/history,
298311 * size, user links, and a comment
@@ -303,14 +316,9 @@ function () {
303316public function formatRow ( $ result ) {
304317$ title = Title::newFromRow ( $ result );
305318
306- # Revision deletion works on revisions, so we should cast one
307- $ row = [
308- 'comment ' => $ result ->rc_comment ,
309- 'deleted ' => $ result ->rc_deleted ,
310- 'user_text ' => $ result ->rc_user_text ,
311- 'user ' => $ result ->rc_user ,
312- ];
313- $ rev = new Revision ( $ row );
319+ // Revision deletion works on revisions,
320+ // so cast our recent change row to a revision row.
321+ $ rev = $ this ->revisionFromRcResult ( $ result );
314322$ rev ->setTitle ( $ title );
315323
316324$ classes = [];
@@ -477,7 +485,7 @@ protected function feedItemAuthor( $row ) {
477485}
478486
479487protected function feedItemDesc ( $ row ) {
480- $ revision = Revision:: newFromId ( $ row-> rev_id );
488+ $ revision = $ this -> revisionFromRcResult ( $ row );
481489if ( $ revision ) {
482490// XXX: include content model/type in feed item?
483491return '<p> ' . htmlspecialchars ( $ revision ->getUserText () ) .
0 commit comments