Feature #8930
Model document need a valid filename as title
Status: | Closed | Start date: | 2011-07-28 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | Plugin API | |||
Target version: | - | |||
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 :)
History
#1
Updated by Terence Mill about 11 years ago
+1 to be able to use "PluginWebDav":projects/redmine/wiki/PluginWebDav with windows.
Its more a bug in context of the plugin than a feature.
#2
Updated by Jean-Baptiste Barth over 9 years ago
- Status changed from New to Closed
Old issue + this could be done in the plugin I think