From f5313094dd7972c17756848f4b63a795f680e8d8 Mon Sep 17 00:00:00 2001 From: Master Yoda Date: Sun, 18 Nov 2018 14:16:45 -0800 Subject: [PATCH 1/2] Revert RedirectResponse changes --- system/Common.php | 3 ++- system/HTTP/Response.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/Common.php b/system/Common.php index 1be3550d6742..3e4a3b5d6cb2 100644 --- a/system/Common.php +++ b/system/Common.php @@ -818,7 +818,8 @@ function redirect(string $uri = null) if (! empty($uri)) { - return $response->route($uri); + // return $response->route($uri); + return $response->to($uri); } return $response; diff --git a/system/HTTP/Response.php b/system/HTTP/Response.php index 4cf7d113a1af..50393fc02d73 100644 --- a/system/HTTP/Response.php +++ b/system/HTTP/Response.php @@ -755,7 +755,7 @@ public function redirect(string $uri, string $method = 'auto', int $code = null) } $this->setStatusCode($code); - + $this->sendHeaders(); return $this; } From 5af4a08f63d31305f40719d21fdee203b3321b73 Mon Sep 17 00:00:00 2001 From: Master Yoda Date: Sun, 18 Nov 2018 14:30:53 -0800 Subject: [PATCH 2/2] Fix old() & pass unit tests --- system/Common.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/system/Common.php b/system/Common.php index 3e4a3b5d6cb2..1d45a7bb0327 100644 --- a/system/Common.php +++ b/system/Common.php @@ -783,13 +783,13 @@ function old(string $key, $default = null, $escape = 'html') } // If the result was serialized array or string, then unserialize it for use... - // if (is_string($value)) - // { - if (strpos($value, 'a:') === 0 || strpos($value, 's:') === 0) + if (is_string($value)) + { + if (strpos($value, 'a:') === 0 || strpos($value, 's:') === 0) { - $value = unserialize($value); + $value = unserialize($value); + } } - // } return $escape === false ? $value : esc($value, $escape); } @@ -818,7 +818,6 @@ function redirect(string $uri = null) if (! empty($uri)) { - // return $response->route($uri); return $response->to($uri); }