summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorRick Ellis <rick.ellis@ellislab.com>2008-10-26 23:25:03 +0100
committerRick Ellis <rick.ellis@ellislab.com>2008-10-26 23:25:03 +0100
commitd0c870a0014d7d86a07fe8c75ad90ca562974d80 (patch)
treec582fe2f7221b7d481bb47013aab1e2d3a9ae1d6 /system/libraries
parentbfafdc572c34a726ecd601b77ed0217c3fb1be47 (diff)
Fixed bug #5702, in which the field label was not being fetched properly, when "matching" one field to another.
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Form_validation.php9
1 files changed, 8 insertions, 1 deletions
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);