Ticket #1899 (closed bug: fixed)

Opened 12 years ago

Last modified 11 years ago

File insert: forbid inserting files of non-supported filetypes at least.

Reported by: deyan Owned by: george
Priority: major Milestone: M11_BETA3
Component: uncategorized Version: 2.0
Keywords: Cc:
Category: unknown Effort:
Importance: Ticket_group:
Estimated Number of Hours: 0 Add Hours to Ticket: 0
Billable?: yes Total Hours: 0
Analysis_owners: deyan Design_owners: george
Imp._owners: george Test_owners: vanya
Analysis_reviewers: george Changelog:
Design_reviewers: deyan, meddle Imp._reviewers: deyan, meddle
Test_reviewers: Analysis_score: 2
Design_score: 2 Imp._score: 2
Test_score: 0

Description

File insert: forbid inserting files of non-supported filetypes at least. Do not allow inserting avi instead of audio for example. This one is still present. This should be solved for all from->to cases!

Change History

comment:1 Changed 12 years ago by deyan

  • Status changed from new to s1b_analysis_finished

comment:2 Changed 12 years ago by george

  • Design_owners set to george
  • Status changed from s1b_analysis_finished to s2a_design_started

comment:3 Changed 12 years ago by george

  • Status changed from s2a_design_started to s2b_design_finished

The problem is the same as #1809. The only difference is that this bug refers to one more situation - inserting files that do not exist. Part 2. of the solution handles this situation.

  • The problem is that "All Files" dropdown always active, allowing the user to skip file filters, thus allowing him to add an image as a pdf file or even an unsupported file.

Solution:

  1. "All files" dropdown in FileDialog is now removed. This is not enough however, user can type in the name of an existing resource file, for example an image, when inserting a pdf file, and the result will be the same as without the FileDialog modification. That is why another check is made - if the opened file is accepted by the chosen file filter, in the FileDialogInput. Changes can be seen here: FileDialog.
  1. Changes in all logics that import files are made. A check is made, if the file selected for importing exists. Changeset [5131].

comment:4 Changed 12 years ago by george

  • Status changed from s2b_design_finished to s2c_design_ok

comment:5 Changed 12 years ago by george

  • Owner set to george
  • Status changed from s2c_design_ok to s3a_implementation_started

comment:6 Changed 12 years ago by george

  • Status changed from s3a_implementation_started to s3b_implementation_finished

comment:7 Changed 12 years ago by meddle

  • Status changed from s3b_implementation_finished to s2c_design_ok
  • Imp._owners set to george
  • Analysis_reviewers set to george
  • Analysis_score changed from 0 to 2
  • Imp._reviewers set to deyan, meddle
  • Design_score changed from 0 to 2
  • Design_reviewers set to deyan, meddle
  • Imp._score changed from 0 to 2
  • Do not remove "All files" item. Just add a check if the extension is proper, if not - bring a dialog "Unsupported image" "Unsupported book",... etc. Later a mimetype check may be implemented. This way the fix will make it to trunk. Otherwise good job.
  • Code notes:
    • What is that strange check : pdfFile.exists() == true, just check pdfFile.exists() and if you want to check if something boolean is false, check !something
  • Svn notes:
    • Don't commit the target directory!

Write your name as a analysis reviewer (you understood the bug) and implementation owner.

comment:8 Changed 12 years ago by george

There is a better solution using MIME utils. With mime you can check the input file's type regardless about the file extension. Implementation for the idea: [5174], see code at FileDialog.java.

comment:9 Changed 11 years ago by vanya

  • Status changed from s2c_design_ok to closed
  • Test_owners set to vanya
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.