Merge "(bug 25830) fix JS preview causing the page to "jump""
[lhc/web/wiklou.git] / includes / api / ApiFormatBase.php
index 1c6a871..54c90a6 100644 (file)
@@ -143,6 +143,12 @@ 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" );
+               }
+
                if ( $isHtml ) {
 ?>
 <!DOCTYPE HTML>
@@ -326,7 +332,7 @@ class ApiFormatFeedWrapper extends ApiFormatBase {
         */
        public static function setResult( $result, $feed, $feedItems ) {
                // Store output in the Result data.
-               // This way we can check during execution if any error has occured
+               // This way we can check during execution if any error has occurred
                // Disable size checking for this because we can't continue
                // cleanly; size checking would cause more problems than it'd
                // solve
@@ -371,7 +377,7 @@ class ApiFormatFeedWrapper extends ApiFormatBase {
                        }
                        $feed->outFooter();
                } else {
-                       // Error has occured, print something useful
+                       // Error has occurred, print something useful
                        ApiBase::dieDebug( __METHOD__, 'Invalid feed class/item' );
                }
        }