summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-04-14 15:56:28 +0200
committerAndrey Andreev <narf@devilix.net>2015-04-14 15:56:28 +0200
commit5d8e2a6e4c50b772f4b789ea5d831f47c45dc851 (patch)
treee819ab69efe6fbbb36bb1bbccfc29fd72b40e44f
parent8af87468487101e14e69effb80a166870f1b79be (diff)
Fix #3771
-rw-r--r--system/libraries/Form_validation.php14
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 5 insertions, 10 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 522eba704..bb872c7cc 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -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;
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 596cd0faf..5454638ac 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -18,6 +18,7 @@ Bug fixes for 3.0.1
- Fixed a bug (#3744) - Redis :doc:`Caching <libraries/caching>` driver didn't handle authentication failures properly.
- Fixed a bug (#3761) - :doc:`URL Helper <helpers/url_helper>` function :php:func:`anchor()` didn't work with array inputs.
- Fixed a bug (#3773) - ``db_select()`` didn't work for MySQL with the PDO :doc:`Database <database/index>` driver.
+- Fixed a bug (#3771) - :doc:`Form Validation Library <libraries/form_validation>` was looking for a 'form_validation_' prefix when trying to translate field name labels.
Version 3.0.0
=============