From 4ab1dbddd0b6e185bccdcfc1fd71e47012ea848e Mon Sep 17 00:00:00 2001 From: cos800 Date: Fri, 8 Apr 2016 16:05:21 +0800 Subject: [PATCH] =?UTF-8?q?hook=20return=5Fdata=20=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixed https://github.com/top-think/think/issues/438 --- library/think/Response.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/library/think/Response.php b/library/think/Response.php index 45507c35..536be418 100644 --- a/library/think/Response.php +++ b/library/think/Response.php @@ -61,17 +61,11 @@ class Response $handler = !empty($_GET[Config::get('var_jsonp_handler')]) ? $_GET[Config::get('var_jsonp_handler')] : Config::get('default_jsonp_handler'); $data = $handler . '(' . json_encode($data, JSON_UNESCAPED_UNICODE) . ');'; break; - case '': - case 'html': - case 'text': - // 不做处理 - break; - default: - // 用于扩展其他返回格式数据 - APP_HOOK && Hook::listen('return_data', $data); } } + APP_HOOK && Hook::listen('return_data', $data); + if ($return) { return $data; }