• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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]
 
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic