Skip to content

Commit

Permalink
Updated for K2.4. This is a fork from the main-line, but we're going …
Browse files Browse the repository at this point in the history
…to replace this with Formio anyway.
  • Loading branch information
bharat committed Dec 7, 2009
1 parent dec084f commit 0a34589
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules/forge/libraries/Form_Input.php
Expand Up @@ -317,7 +317,7 @@ public function error_messages($func = NULL, $message = NULL)
$args = is_array($args) ? $args : array();

// Add the label or name to the beginning of the args
array_unshift($args, $this->label ? utf8::strtolower($this->label) : $this->name);
array_unshift($args, $this->label ? mb_strtolower($this->label) : $this->name);

if (isset($this->error_messages[$func]))
{
Expand All @@ -333,7 +333,7 @@ public function error_messages($func = NULL, $message = NULL)
case 'valid_email':
case 'valid_ip':
// Fetch an i18n error message
$error = Kohana::lang('validation.'.$func, $args);
$error = 'validation.'.$func;
break;
case substr($func, 0, 6) === 'valid_':
// Strip 'valid_' from func name
Expand All @@ -343,11 +343,11 @@ public function error_messages($func = NULL, $message = NULL)
case 'digit':
case 'numeric':
// i18n strings have to be inserted into valid_type
$args[] = Kohana::lang('validation.'.$func);
$error = Kohana::lang('validation.valid_type', $args);
$args[] = 'validation.'.$func;
$error = 'validation.valid_type';
break;
default:
$error = Kohana::lang('validation.'.$func, $args);
$error = 'validation.'.$func;
}
}
}
Expand Down Expand Up @@ -490,7 +490,7 @@ public function validate()
if ($this->value != $input->value)
{
// Field does not match
$this->errors['matches'] = array($input->label ? utf8::strtolower($input->label) : $input->name);
$this->errors['matches'] = array($input->label ? mb_strtolower($input->label) : $input->name);
break;
}
}
Expand Down Expand Up @@ -529,7 +529,7 @@ protected function rule_required()
protected function rule_length($min, $max = NULL)
{
// Get the length, return if zero
if (($length = utf8::strlen($this->value)) === 0)
if (($length = mb_strlen($this->value)) === 0)
return;

if ($max == NULL)
Expand Down

0 comments on commit 0a34589

Please sign in to comment.