From: Michael Dale Date: Sat, 15 Aug 2009 22:38:01 +0000 (+0000) Subject: * removed plain-text output because IE is retarded treats plain-text as html (in... X-Git-Tag: 1.31.0-rc.0~40283 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=52c5db1a47719ef83b7475277da4031e8c88a9c5;p=lhc%2Fweb%2Fwiklou.git * removed plain-text output because IE is retarded treats plain-text as html (in fact no mime type I have found lets you send text to IE and have it treat it like text :( .... --- diff --git a/includes/api/ApiFormatJson.php b/includes/api/ApiFormatJson.php index 888be28336..c789fbb378 100644 --- a/includes/api/ApiFormatJson.php +++ b/includes/api/ApiFormatJson.php @@ -46,10 +46,6 @@ class ApiFormatJson extends ApiFormatBase { if( $params['callback']){ return 'text/javascript'; } - //check for text content request - if( isset( $params['ctypetext']) && $params['ctypetext']) { - return 'text/plain'; - } return 'application/json'; } @@ -86,22 +82,20 @@ class ApiFormatJson extends ApiFormatBase { if (!function_exists('json_encode') || $isHtml || strtolower(json_encode("\xf0\xa0\x80\x80")) != '\ud840\udc00') { $json = new Services_JSON(); return $json->encode($value, $isHtml) ; - } else { + } else { return json_encode($value); } } public function getAllowedParams() { return array ( - 'callback' => null, - 'ctypetext' => null + '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.', - 'ctypetext'=> 'Used to set the content type of the json result to plain-text (useful for evaling iframe uploads)', + 'callback' => 'If specified, wraps the output into a given function call. For safety, all user-specific data will be restricted.', ); }