Stop calling FileRepo->streamFile()
[lhc/web/wiklou.git] / includes / FeedUtils.php
index 4dde52d..0a88b23 100644 (file)
@@ -20,6 +20,7 @@
  * @file
  * @ingroup Feed
  */
+use MediaWiki\MediaWikiServices;
 
 /**
  * Helper functions for feeds
@@ -41,7 +42,7 @@ class FeedUtils {
                $purge = $wgRequest->getVal( 'action' ) === 'purge';
                // Allow users with 'purge' right to clear feed caches
                if ( $purge && $wgUser->isAllowed( 'purge' ) ) {
-                       $cache = ObjectCache::getMainWANInstance();
+                       $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
                        $cache->delete( $timekey, 1 );
                        $cache->delete( $key, 1 );
                }
@@ -173,7 +174,7 @@ class FeedUtils {
 
                        if ( $newContent instanceof TextContent ) {
                                // only textual content has a "source view".
-                               $text = $newContent->getNativeData();
+                               $text = $newContent->getText();
 
                                if ( $wgFeedDiffCutoff <= 0 || strlen( $text ) > $wgFeedDiffCutoff ) {
                                        $html = null;