diff --git a/system/Validation/Validation.php b/system/Validation/Validation.php index 155efc223492..f330c91799f6 100644 --- a/system/Validation/Validation.php +++ b/system/Validation/Validation.php @@ -108,6 +108,12 @@ public function __construct($config, RendererInterface $view) */ public function run(?array $data = null, ?string $group = null, ?string $dbGroup = null): bool { + // If there are still validation errors for redirect_with_input request, remove them. + // See `getErrors()` method. + if (isset($_SESSION, $_SESSION['_ci_validation_errors'])) { + unset($_SESSION['_ci_validation_errors']); + } + $data ??= $this->data; // i.e. is_unique