From: csteipp Date: Tue, 21 Aug 2012 18:55:48 +0000 (-0700) Subject: (bug 38082) Check read permissions in ApiFeedContribs X-Git-Tag: 1.31.0-rc.0~19896 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=d3208b719bdec5133076f21ca1f34eaa4322c5ae;p=lhc%2Fweb%2Fwiklou.git (bug 38082) Check read permissions in ApiFeedContribs Before showing the contents of a title in the generated feed, check that the calling user has permissions to read the specific title. Change-Id: Iba16a5489d80cd4f0958ad6bbcf2e1a948e97f93 --- diff --git a/includes/api/ApiFeedContributions.php b/includes/api/ApiFeedContributions.php index a11563b047..f2a7748772 100644 --- a/includes/api/ApiFeedContributions.php +++ b/includes/api/ApiFeedContributions.php @@ -93,7 +93,7 @@ class ApiFeedContributions extends ApiBase { protected function feedItem( $row ) { $title = Title::makeTitle( intval( $row->page_namespace ), $row->page_title ); - if ( $title ) { + if( $title && $title->userCan( 'read' ) ) { $date = $row->rev_timestamp; $comments = $title->getTalkPage()->getFullURL(); $revision = Revision::newFromRow( $row ); @@ -106,9 +106,8 @@ class ApiFeedContributions extends ApiBase { $this->feedItemAuthor( $revision ), $comments ); - } else { - return null; } + return null; } /**