Unify the spelling of MIME in documentation
[lhc/web/wiklou.git] / includes / api / ApiFormatBase.php
index 8954abc..3a0ed46 100644 (file)
@@ -52,7 +52,7 @@ abstract class ApiFormatBase extends ApiBase {
        }
 
        /**
-        * Overriding class returns the mime type that should be sent to the client.
+        * Overriding class returns the MIME type that should be sent to the client.
         * This method is not called if getIsHtml() returns true.
         * @return string
         */
@@ -154,9 +154,9 @@ abstract class ApiFormatBase extends ApiBase {
                $this->getMain()->getRequest()->response()->header( "Content-Type: $mime; charset=utf-8" );
 
                //Set X-Frame-Options API results (bug 39180)
-               global $wgApiFrameOptions;
-               if ( $wgApiFrameOptions ) {
-                       $this->getMain()->getRequest()->response()->header( "X-Frame-Options: $wgApiFrameOptions" );
+               $apiFrameOptions = $this->getConfig()->get( 'ApiFrameOptions' );
+               if ( $apiFrameOptions ) {
+                       $this->getMain()->getRequest()->response()->header( "X-Frame-Options: $apiFrameOptions" );
                }
 
                if ( $isHtml ) {
@@ -354,7 +354,7 @@ class ApiFormatFeedWrapper extends ApiFormatBase {
         * Call this method to initialize output data. See execute()
         * @param ApiResult $result
         * @param object $feed An instance of one of the $wgFeedClasses classes
-        * @param array $feedItems of FeedItem objects
+        * @param array $feedItems Array of FeedItem objects
         */
        public static function setResult( $result, $feed, $feedItems ) {
                // Store output in the Result data.
@@ -362,10 +362,8 @@ class ApiFormatFeedWrapper extends ApiFormatBase {
                // Disable size checking for this because we can't continue
                // cleanly; size checking would cause more problems than it'd
                // solve
-               $result->disableSizeCheck();
-               $result->addValue( null, '_feed', $feed );
-               $result->addValue( null, '_feeditems', $feedItems );
-               $result->enableSizeCheck();
+               $result->addValue( null, '_feed', $feed, ApiResult::NO_SIZE_CHECK );
+               $result->addValue( null, '_feeditems', $feedItems, ApiResult::NO_SIZE_CHECK );
        }
 
        /**