From d0c870a0014d7d86a07fe8c75ad90ca562974d80 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sun, 26 Oct 2008 22:25:03 +0000 Subject: Fixed bug #5702, in which the field label was not being fetched properly, when "matching" one field to another. --- system/libraries/Form_validation.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index d51f9400c..0c7687aa1 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -662,7 +662,14 @@ class CI_Form_validation { { $line = $this->_error_messages[$rule]; } - + + // Is the parameter we are inserting into the error message the name + // of another field? If so we need to grab its "field label" + if (isset($this->_field_data[$param]) AND isset($this->_field_data[$param]['label'])) + { + $param = $this->_field_data[$param]['label']; + } + // Build the error message $message = sprintf($line, $this->_translate_fieldname($row['label']), $param); -- cgit v1.2.3-24-g4f1b