summaryrefslogtreecommitdiffstats
path: root/system/libraries/Form_validation.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r--system/libraries/Form_validation.php16
1 files changed, 5 insertions, 11 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 522eba704..7599602c0 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -461,7 +461,7 @@ class CI_Form_validation {
{
$this->_field_data[$field]['postdata'] = $this->_reduce_array($validation_array, $row['keys']);
}
- elseif (isset($validation_array[$field]) && $validation_array[$field] !== '')
+ elseif (isset($validation_array[$field]))
{
$this->_field_data[$field]['postdata'] = $validation_array[$field];
}
@@ -870,17 +870,11 @@ class CI_Form_validation {
*/
protected function _translate_fieldname($fieldname)
{
- // Do we need to translate the field name?
- // We look for the prefix lang: to determine this
- if (sscanf($fieldname, 'lang:%s', $line) === 1)
+ // Do we need to translate the field name? We look for the prefix 'lang:' to determine this
+ // If we find one, but there's no translation for the string - just return it
+ if (sscanf($fieldname, 'lang:%s', $line) === 1 && FALSE === ($fieldname = $this->CI->lang->line($line, FALSE)))
{
- // Were we able to translate the field name? If not we use $line
- if (FALSE === ($fieldname = $this->CI->lang->line('form_validation_'.$line))
- // DEPRECATED support for non-prefixed keys
- && FALSE === ($fieldname = $this->CI->lang->line($line, FALSE)))
- {
- return $line;
- }
+ return $line;
}
return $fieldname;