• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

BadExtensionException isn't handled when inserting a new post with an attachment with forbidden ext

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JIRA: http://www.jforum.net/jira/browse/JF-684

When sending a new post (either a new topic or a reply to an existing topic), attaching a file with a forbidden extension throws a BadExtensionException, which isn't handled. The user sees an error page with a Java stacktrace in the source code.

This is a bug in the net.jforum.view.forum.PostAction class: there are two calls to attachments.preProcess(), one in editSave() and one in insertSave(). The first does a try, catch (AttachmentException e) where as the latter does a try, catch (AttachmentSizeTooBigException e), thus ignoring the BadExtensionException.

Fix is easy: change AttachmentSizeTooBigException to AttachmentException on line 1048. Tested on JForum 2.1.7.
[originally posted on jforum.net by jooooooon]
 
If a regular clown is funny, then a larger clown would be funnier. Math. Verified by this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic