From 613d9ce787fd65d6c186bb76716b3e1a48e1521e Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Sat, 1 Oct 2011 13:19:55 +0200 Subject: Bug 582529: Ambiguous error message "You did not specify a file to attach" when deleting an existing attachment filename a=LpSolit --- Bugzilla/Attachment.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index a39dc3af4..3a8e7d5d5 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -565,7 +565,14 @@ sub _check_filename { my ($invocant, $filename) = @_; $filename = clean_text($filename); - $filename || ThrowUserError('file_not_specified'); + if (!$filename) { + if (ref $invocant) { + ThrowUserError('filename_not_specified'); + } + else { + ThrowUserError('file_not_specified'); + } + } # Remove path info (if any) from the file name. The browser should do this # for us, but some are buggy. This may not work on Mac file names and could -- cgit v1.2.3-24-g4f1b