Robert Vogel has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/277467

Change subject: Removed legacy override
......................................................................

Removed legacy override

This override was introduced in an earlier version and has acutally no
impact anymore.

Change-Id: I26f870162a5944e4ab68b1f3361ae531df8b11b2
---
M includes/AutoLoader.php
D includes/api/ApiFormatJsonMW.php
2 files changed, 1 insertion(+), 80 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/67/277467/1

diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php
index ff0c1b6..fb70072 100644
--- a/includes/AutoLoader.php
+++ b/includes/AutoLoader.php
@@ -132,10 +132,7 @@
 $GLOBALS['wgAutoloadClasses']['ViewUserMiniProfile'] = __DIR__ . 
'/outputhandler/views/view.UserMiniProfile.php';
 $GLOBALS['wgAutoloadClasses']['ViewWidget'] = __DIR__ . 
'/outputhandler/views/view.Widget.php';
 
-//Overrides
-// Replace Mediawikis ApiFormatJson class with our own to prevent some errors 
with the application/json header.
-$GLOBALS['wgAutoloadClasses']['ApiFormatJson'] = 
__DIR__."/api/ApiFormatJsonMW.php";
-
+//Resourceloader modules
 $GLOBALS['wgAutoloadClasses']['ResourceLoaderExtJSModule'] = 
__DIR__."/resourceloader/ResourceLoaderExtJSModule.php";
 
 /**
diff --git a/includes/api/ApiFormatJsonMW.php b/includes/api/ApiFormatJsonMW.php
deleted file mode 100644
index aa39b4b..0000000
--- a/includes/api/ApiFormatJsonMW.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-
-class ApiFormatJson extends ApiFormatBase {
-
-       private $mIsRaw;
-
-       public function __construct( $main, $format ) {
-               parent::__construct( $main, $format );
-               $this->mIsRaw = ( $format === 'rawfm' );
-       }
-
-       public function getMimeType() {
-               $params = $this->extractRequestParams();
-               // callback:
-               if ( $params['callback'] ) {
-                       return 'text/javascript';
-               }
-               return 'text/html';
-       }
-
-       public function getNeedsRawData() {
-               return $this->mIsRaw;
-       }
-
-       public function getWantsHelp() {
-               // Help is always ugly in JSON
-               return false;
-       }
-
-       public function execute() {
-               $prefix = $suffix = '';
-
-               $params = $this->extractRequestParams();
-               $callback = $params['callback'];
-               if ( !is_null( $callback ) ) {
-                       $prefix = preg_replace( "/[^][.\\'\\\"_A-Za-z0-9]/", 
'', $callback ) . '(';
-                       $suffix = ')';
-               }
-
-               if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                       $data = $this->getResult()->getResultData( null, array(
-                               'BC' => array(),
-                               'Types' => array(),
-                               'Strip' => 'all',
-                       ) );
-               } else {
-                       $data = $this->getResultData();
-               }
-
-               $this->printText(
-                       $prefix .
-                       FormatJson::encode( $data, $this->getIsHtml() ) .
-                       $suffix
-               );
-       }
-
-       public function getAllowedParams() {
-               return array(
-                       'callback'  => null,
-               );
-       }
-
-       public function getParamDescription() {
-               return array(
-                       'callback' => 'If specified, wraps the output into a 
given function call. For safety, all user-specific data will be restricted.',
-               );
-       }
-
-       public function getDescription() {
-               if ( $this->mIsRaw ) {
-                       return 'Output data with the debuging elements in JSON 
format' . parent::getDescription();
-               } else {
-                       return 'Output data in JSON format' . 
parent::getDescription();
-               }
-       }
-}

-- 
To view, visit https://gerrit.wikimedia.org/r/277467
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I26f870162a5944e4ab68b1f3361ae531df8b11b2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to