fixed validator bug.
This commit is contained in:
parent
895d876463
commit
23fcf35804
|
@ -39,27 +39,35 @@
|
||||||
"alpha" => "The :attribute may only contain letters.",
|
"alpha" => "The :attribute may only contain letters.",
|
||||||
"alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.",
|
"alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.",
|
||||||
"alpha_num" => "The :attribute may only contain letters and numbers.",
|
"alpha_num" => "The :attribute may only contain letters and numbers.",
|
||||||
"between" => "The :attribute must be between :min - :max.",
|
"between" => array(
|
||||||
"between.file" => "The :attribute must be between :min - :max kilobytes.",
|
"numeric" => "The :attribute must be between :min - :max.",
|
||||||
"between.string" => "The :attribute must be between :min - :max characters.",
|
"file" => "The :attribute must be between :min - :max kilobytes.",
|
||||||
|
"string" => "The :attribute must be between :min - :max characters.",
|
||||||
|
),
|
||||||
"confirmed" => "The :attribute confirmation does not match.",
|
"confirmed" => "The :attribute confirmation does not match.",
|
||||||
"email" => "The :attribute format is invalid.",
|
"email" => "The :attribute format is invalid.",
|
||||||
"image" => "The :attribute must be an image.",
|
"image" => "The :attribute must be an image.",
|
||||||
"in" => "The selected :attribute is invalid.",
|
"in" => "The selected :attribute is invalid.",
|
||||||
"integer" => "The :attribute must be an integer.",
|
"integer" => "The :attribute must be an integer.",
|
||||||
"max" => "The :attribute must be less than :max.",
|
"max" => array(
|
||||||
"max.file" => "The :attribute must be less than :max kilobytes.",
|
"numeric" => "The :attribute must be less than :max.",
|
||||||
"max.string" => "The :attribute must be less than :max characters.",
|
"file" => "The :attribute must be less than :max kilobytes.",
|
||||||
|
"string" => "The :attribute must be less than :max characters.",
|
||||||
|
),
|
||||||
"mimes" => "The :attribute must be a file of type: :values.",
|
"mimes" => "The :attribute must be a file of type: :values.",
|
||||||
"min" => "The :attribute must be at least :min.",
|
"min" => array(
|
||||||
"min.file" => "The :attribute must be at least :min kilobytes.",
|
"numeric" => "The :attribute must be at least :min.",
|
||||||
"min.string" => "The :attribute must be at least :min characters.",
|
"file" => "The :attribute must be at least :min kilobytes.",
|
||||||
|
"string" => "The :attribute must be at least :min characters.",
|
||||||
|
),
|
||||||
"not_in" => "The selected :attribute is invalid.",
|
"not_in" => "The selected :attribute is invalid.",
|
||||||
"numeric" => "The :attribute must be a number.",
|
"numeric" => "The :attribute must be a number.",
|
||||||
"required" => "The :attribute field is required.",
|
"required" => "The :attribute field is required.",
|
||||||
"size" => "The :attribute must be :size.",
|
"size" => array(
|
||||||
"size.file" => "The :attribute must be :size kilobyte.",
|
"numeric" => "The :attribute must be :size.",
|
||||||
"size.string" => "The :attribute must be :size characters.",
|
"file" => "The :attribute must be :size kilobyte.",
|
||||||
|
"string" => "The :attribute must be :size characters.",
|
||||||
|
),
|
||||||
"unique" => "The :attribute has already been taken.",
|
"unique" => "The :attribute has already been taken.",
|
||||||
"url" => "The :attribute format is invalid.",
|
"url" => "The :attribute format is invalid.",
|
||||||
|
|
||||||
|
|
|
@ -534,9 +534,16 @@ protected function message($attribute, $rule)
|
||||||
// If the rule being validated is a "size" rule and the attribute is not
|
// If the rule being validated is a "size" rule and the attribute is not
|
||||||
// a number, we will need to gather the specific size message for the
|
// a number, we will need to gather the specific size message for the
|
||||||
// type of attribute being validated, either a file or a string.
|
// type of attribute being validated, either a file or a string.
|
||||||
elseif (isset($this->size_rules[$rule]) and ! $this->has_rule($attribute, $this->numeric_rules))
|
elseif (in_array($rule, $this->size_rules))
|
||||||
{
|
{
|
||||||
$line = (array_key_exists($attribute, Input::file())) ? "file" : "string";
|
if ($this->has_rule($attribute, $this->numeric_rules))
|
||||||
|
{
|
||||||
|
$line = 'numeric';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$line = (array_key_exists($attribute, Input::file())) ? 'file' : 'string';
|
||||||
|
}
|
||||||
|
|
||||||
return Lang::line("validation.{$rule}.{$line}")->get($this->language);
|
return Lang::line("validation.{$rule}.{$line}")->get($this->language);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue