Actions
Feature #8930
closedModel document need a valid filename as title
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Plugin API
Target version:
-
Start date:
2011-07-28
Due date:
% Done:
0%
Estimated time:
Resolution:
Description
I use the WebDav-Plugin to manage my documentes.
With Redmine i can create a new document with caracters(< > ? " : | \ / *) that cant handle by windows.
All i need is to add a "validates_format_of" in app/models/document.rb with regex /\A([^<>\?":\|\\\/\*]+)\Z/i.
The Regex filters the caracters(< > ? " : | \ / *). If one of these found, we get an error.
After line 30:
... validates_presence_of :project, :title, :category validates_length_of :title, :maximum => 60 # valid title (filename) for Windows validates_format_of :title, :with => /\A([^<>\?":\|\\\/\*]+)\Z/i, :on => :save named_scope :visible, lambda {|*args| { :include => :project, :conditions => Project.allowed_to_condition(args.shift || User.current, :view_documents, *args) } } ...
Source: http://en.wikipedia.org/wiki/8.3_filename#Directory_table
This excludes the following ASCII characters: " * / : < > ? \ | Windows/MSDOS has no shell escape character
I hope u add this to core :)
Actions