Commit 0013e5bc by Taylor Otwell

Fixed bug in validator message handling for empty file uploads.

parent cbf2399a
...@@ -89,6 +89,17 @@ class Message { ...@@ -89,6 +89,17 @@ class Message {
private static function get_upload_of_message($rule) private static function get_upload_of_message($rule)
{ {
// --------------------------------------------------------- // ---------------------------------------------------------
// Upload_Of rules sometimes set a "presence_of" error.
//
// This occurs when the uploaded file didn't exist and the
// "not_required" method was not called.
// ---------------------------------------------------------
if ($rule->error == 'presence_of')
{
return static::get_message($rule);
}
// ---------------------------------------------------------
// Slice "file_" off of the error type. // Slice "file_" off of the error type.
// --------------------------------------------------------- // ---------------------------------------------------------
$error_type = substr($rule->error, 5); $error_type = substr($rule->error, 5);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment