X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFeedContributions.php;h=08be8e029c9f9c6d27d4dbe26350a69ba40b31ac;hb=8963110d01b0f376d900171fe7506fed5df80cf8;hp=9edf929f8eaf2f4cf5982cb56c5adddd08078e10;hpb=93350da7f1ab397b87c3ac3073ddfc1c857b272e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFeedContributions.php b/includes/api/ApiFeedContributions.php index 9edf929f8e..08be8e029c 100644 --- a/includes/api/ApiFeedContributions.php +++ b/includes/api/ApiFeedContributions.php @@ -137,8 +137,10 @@ class ApiFeedContributions extends ApiBase { } // Hook completed and did not return a valid feed item - $title = Title::makeTitle( intval( $row->page_namespace ), $row->page_title ); - if ( $title && $title->userCan( 'read', $this->getUser() ) ) { + $title = Title::makeTitle( (int)$row->page_namespace, $row->page_title ); + $user = $this->getUser(); + + if ( $title && $this->getPermissionManager()->userCan( 'read', $user, $title ) ) { $date = $row->rev_timestamp; $comments = $title->getTalkPage()->getFullURL(); $revision = $this->revisionStore->newRevisionFromRow( $row ); @@ -181,7 +183,7 @@ class ApiFeedContributions extends ApiBase { if ( $content instanceof TextContent ) { // only textual content has a "source view". - $html = nl2br( htmlspecialchars( $content->getNativeData() ) ); + $html = nl2br( htmlspecialchars( $content->getText() ) ); } else { // XXX: we could get an HTML representation of the content via getParserOutput, but that may // contain JS magic and generally may not be suitable for inclusion in a feed.