summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Attachment.pm9
-rw-r--r--template/en/default/global/user-error.html.tmpl4
2 files changed, 12 insertions, 1 deletions
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
diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl
index 35640b220..265a061d1 100644
--- a/template/en/default/global/user-error.html.tmpl
+++ b/template/en/default/global/user-error.html.tmpl
@@ -599,6 +599,10 @@
[% title = "No File Specified" %]
You did not specify a file to attach.
+ [% ELSIF error == "filename_not_specified" %]
+ [% title = "No Filename Specified" %]
+ You must specify a filename for this attachment.
+
[% ELSIF error == "file_too_large" %]
[% title = "File Too Large" %]
[%# Convert maxlocalattachment from Mb to Kb %]