From 40a4aa22e9652907458275074582877d61d8f105 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 16 Aug 2022 10:47:26 +0900 Subject: [PATCH] refactor: run rector --- system/Validation/Validation.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/system/Validation/Validation.php b/system/Validation/Validation.php index ed14e1c3994c..892b6837813d 100644 --- a/system/Validation/Validation.php +++ b/system/Validation/Validation.php @@ -695,10 +695,8 @@ public function getErrors(bool $withSessionErrors = true): array // Check the session to see if any were // passed along from a redirect withErrors() request. - if (isset($_SESSION, $_SESSION['_ci_validation_errors'])) { - if (ENVIRONMENT === 'testing' || ! is_cli()) { - $this->errors = unserialize($_SESSION['_ci_validation_errors']); - } + if (isset($_SESSION, $_SESSION['_ci_validation_errors']) && (ENVIRONMENT === 'testing' || ! is_cli())) { + $this->errors = unserialize($_SESSION['_ci_validation_errors']); } return $this->errors;