From 7a579ca60e270df7aaf23700f0c10048b84d352e Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 7 Jun 2016 12:24:32 +0800 Subject: [PATCH] =?UTF-8?q?404=E5=BC=82=E5=B8=B8=E8=B7=B3=E8=BD=ACURL?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=8F=82=E6=95=B0=20=E6=94=B9=E4=B8=BA=20?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=A8=A1=E6=9D=BF=E5=9C=B0=E5=9D=80=E5=8F=82?= =?UTF-8?q?=E6=95=B0=20http=5Fexception=5Ftemplate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Response.php | 2 +- library/think/exception/Handle.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library/think/Response.php b/library/think/Response.php index 1feec722..3a2c9034 100644 --- a/library/think/Response.php +++ b/library/think/Response.php @@ -223,7 +223,7 @@ class Response public function header($name, $value = null) { if (is_array($name)) { - $this->header = $name; + $this->header = array_merge($this->header, $name); } else { $this->header[$name] = $value; } diff --git a/library/think/exception/Handle.php b/library/think/exception/Handle.php index a4737fc3..1a2dbc61 100644 --- a/library/think/exception/Handle.php +++ b/library/think/exception/Handle.php @@ -95,10 +95,10 @@ class Handle */ protected function renderHttpException(HttpException $e) { - $status = $e->getStatusCode(); - $error = Config::get('http_exception_url'); - if (!APP_DEBUG && !empty($error[$status])) { - return Response::create($error[$status], 'redirect')->send(); + $status = $e->getStatusCode(); + $template = Config::get('http_exception_template'); + if (!APP_DEBUG && !empty($template[$status])) { + return Response::create($template[$status], 'view')->vars(['e' => $e])->send(); } else { return $this->convertExceptionToResponse($e); }