diff options
-rw-r--r-- | doc/bugs/can__39__t_upload_a_simple_png_image:_prohibited_by_allowed__95__attachments___40__file_MIME_type_is_application__47__octet-stream....mdwn | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/bugs/can__39__t_upload_a_simple_png_image:_prohibited_by_allowed__95__attachments___40__file_MIME_type_is_application__47__octet-stream....mdwn b/doc/bugs/can__39__t_upload_a_simple_png_image:_prohibited_by_allowed__95__attachments___40__file_MIME_type_is_application__47__octet-stream....mdwn index 1f893b980..b55605245 100644 --- a/doc/bugs/can__39__t_upload_a_simple_png_image:_prohibited_by_allowed__95__attachments___40__file_MIME_type_is_application__47__octet-stream....mdwn +++ b/doc/bugs/can__39__t_upload_a_simple_png_image:_prohibited_by_allowed__95__attachments___40__file_MIME_type_is_application__47__octet-stream....mdwn @@ -55,3 +55,20 @@ Weird... --[[anarcat]] > > I have a stupid [[patch]] in my git repo which just appends a semicolon to the `::magic()` output, but maybe this should be done in another way... > > > > --[[anarcat]] + +> > > If the regex match isn't necessary and it's just about deleting the +> > > parameters, I think I'd prefer something like +> > > +> > > if (! defined $mimetype) { +> > > ... +> > > } +> > > $mimetype =~ s/;.*//; +> > > +> > > but I'd be hesitant to do that without knowing why Joey implemented it +> > > the way it is. If it's about catching a result from file(1) that +> > > is not, in fact, a MIME type at all (empty string or error message +> > > or something), maybe something more like this? +> > > +> > > if (! defined $mimetype || $mimetype !~ s{[-\w]+/[-\w]+(?:;.*)?}{}) +> > > +> > > (or whatever the allowed characters in MIME types are). --[[smcv]] |