Add Handler::getRouter()
[lhc/web/wiklou.git] / includes / api / ApiFeedContributions.php
index 9edf929..08be8e0 100644 (file)
@@ -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.