diff --git a/library/think/Controller.php b/library/think/Controller.php index ba01953a..ba892cbe 100644 --- a/library/think/Controller.php +++ b/library/think/Controller.php @@ -56,10 +56,16 @@ class Controller protected function beforeAction($method, $options = []) { if (isset($options['only'])) { + if (is_string($options['only'])) { + $options['only'] = explode(',', $options['only']); + } if (!in_array(ACTION_NAME, $options['only'])) { return; } } elseif (isset($options['except'])) { + if (is_string($options['except'])) { + $options['except'] = explode(',', $options['except']); + } if (in_array(ACTION_NAME, $options['except'])) { return; } diff --git a/library/think/Response.php b/library/think/Response.php index 95e53e4b..87a1bcbf 100644 --- a/library/think/Response.php +++ b/library/think/Response.php @@ -230,7 +230,7 @@ class Response public static function redirect($url, $params = []) { $http_response_code = 301; - if (in_array($params, [301, 302])) { + if (is_int($params) && in_array($params, [301, 302])) { $http_response_code = $params; $params = []; }