From e0fb60c6b59ee80d079a7f685db28535be8aaf7c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 15 Jul 2012 14:34:28 +0000 Subject: [PATCH] Adds maxlength=255 attribute on attachment description input field (#11365). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9982 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/attachments/_form.html.erb | 2 +- test/functional/issues_controller_test.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 7eea17bb7..dd55fa3f1 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -10,7 +10,7 @@ <%= file_field_tag 'attachments[1][file]', :size => 30, :id => nil, :class => 'file', :onchange => "checkFileSize(this, #{Setting.attachment_max_size.to_i.kilobytes}, '#{escape_javascript(l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)))}');" -%> - <%= text_field_tag 'attachments[1][description]', '', :id => nil, :class => 'description', :placeholder => l(:label_optional_description) %> + <%= text_field_tag 'attachments[1][description]', '', :id => nil, :class => 'description', :maxlength => 255, :placeholder => l(:label_optional_description) %> <%= link_to_function(image_tag('delete.png'), 'removeFileField(this)', :title => (l(:button_delete))) %> diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 26b9dcb0b..6e09595d8 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -1405,6 +1405,7 @@ class IssuesControllerTest < ActionController::TestCase :tag => 'input', :attributes => {:type => 'file', :name => 'attachments[1][file]'} } + assert_select 'input[name=?][maxlength=255]', 'attachments[1][description]' end def test_get_new_should_prefill_the_form_from_params