Fixed bug in validator message handling for empty file uploads.

This commit is contained in:
Taylor Otwell 2011-06-30 13:46:11 -07:00
parent cbf2399ab8
commit 0013e5bcbe
1 changed files with 11 additions and 0 deletions

View File

@ -88,6 +88,17 @@ private static function get_rangable_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.
// ---------------------------------------------------------