Patch #22337 ยป ignore-settings.yml-git.diff
lib/redmine/helpers/diff.rb | ||
---|---|---|
23 | 23 |
include ERB::Util |
24 | 24 |
include ActionView::Helpers::TagHelper |
25 | 25 |
include ActionView::Helpers::TextHelper |
26 |
include ActionView::Helpers::OutputSafetyHelper |
|
26 | 27 |
attr_reader :diff, :words |
27 | 28 | |
28 | 29 |
def initialize(content_to, content_from) |
... | ... | |
53 | 54 |
else |
54 | 55 |
del_at = pos unless del_at |
55 | 56 |
deleted << ' ' unless deleted.empty? |
56 |
deleted << h(change[2])
|
|
57 |
deleted << change[2]
|
|
57 | 58 |
words_del += 1 |
58 | 59 |
end |
59 | 60 |
end |
... | ... | |
62 | 63 |
words[add_to] = words[add_to] + '</span>'.html_safe |
63 | 64 |
end |
64 | 65 |
if del_at |
65 |
words.insert del_at - del_off + dels + words_add, '<span class="diff_out">'.html_safe + deleted + '</span>'.html_safe |
|
66 |
# deleted is not safe html at this point |
|
67 |
words.insert del_at - del_off + dels + words_add, '<span class="diff_out">'.html_safe + h(deleted) + '</span>'.html_safe |
|
66 | 68 |
dels += 1 |
67 | 69 |
del_off += words_del |
68 | 70 |
words_del = 0 |
69 | 71 |
end |
70 | 72 |
end |
71 |
words.join(' ').html_safe
|
|
73 |
safe_join(words, ' ')
|
|
72 | 74 |
end |
73 | 75 |
end |
74 | 76 |
end |
test/unit/lib/redmine/helpers/diff_test.rb | ||
---|---|---|
22 | 22 |
diff = Redmine::Helpers::Diff.new("foo", "bar") |
23 | 23 |
assert_not_nil diff |
24 | 24 |
end |
25 |
|
|
26 |
def test_dont_double_escape |
|
27 |
# 3 cases to test in the before: first word, last word, everything inbetween |
|
28 |
before = "<stuff> with html & special chars</danger>" |
|
29 |
# all words in after are treated equal |
|
30 |
after = "other stuff <script>alert('foo');</alert>" |
|
31 |
|
|
32 |
computed_diff = Redmine::Helpers::Diff.new(before, after).to_html |
|
33 |
expected_diff = '<span class="diff_in"><stuff> with html & special chars</danger></span> <span class="diff_out">other stuff <script>alert('foo');</alert></span>' |
|
34 |
|
|
35 |
assert_equal computed_diff, expected_diff |
|
36 |
end |
|
25 | 37 |
end |
26 |
- |
.gitignore | ||
---|---|---|
7 | 7 |
/config/database.yml |
8 | 8 |
/config/email.yml |
9 | 9 |
/config/secrets.yml |
10 |
/config/settings.yml |
|
10 | 11 |
/config/initializers/session_store.rb |
11 | 12 |
/config/initializers/secret_token.rb |
12 | 13 |
/coverage |
.hgignore | ||
---|---|---|
9 | 9 |
config/database.yml |
10 | 10 |
config/email.yml |
11 | 11 |
config/secrets.yml |
12 |
config/settings.yml |
|
12 | 13 |
config/initializers/session_store.rb |
13 | 14 |
config/initializers/secret_token.rb |
14 | 15 |
coverage |
config/settings.yml | ||
---|---|---|
1 |
# Redmine - project management software |
|
2 |
# Copyright (C) 2006-2016 Jean-Philippe Lang |
|
3 |
# |
|
4 |
# This program is free software; you can redistribute it and/or |
|
5 |
# modify it under the terms of the GNU General Public License |
|
6 |
# as published by the Free Software Foundation; either version 2 |
|
7 |
# of the License, or (at your option) any later version. |
|
8 |
# |
|
9 |
# This program is distributed in the hope that it will be useful, |
|
10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
# GNU General Public License for more details. |
|
13 |
# |
|
14 |
# You should have received a copy of the GNU General Public License |
|
15 |
# along with this program; if not, write to the Free Software |
|
16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | ||
18 | ||
19 |
# DO NOT MODIFY THIS FILE !!! |
|
20 |
# Settings can be defined through the application in Admin -> Settings |
|
21 | ||
22 |
app_title: |
|
23 |
default: Redmine |
|
24 |
app_subtitle: |
|
25 |
default: Project management |
|
26 |
welcome_text: |
|
27 |
default: |
|
28 |
login_required: |
|
29 |
default: 0 |
|
30 |
security_notifications: 1 |
|
31 |
self_registration: |
|
32 |
default: '2' |
|
33 |
security_notifications: 1 |
|
34 |
lost_password: |
|
35 |
default: 1 |
|
36 |
security_notifications: 1 |
|
37 |
unsubscribe: |
|
38 |
default: 1 |
|
39 |
password_min_length: |
|
40 |
format: int |
|
41 |
default: 8 |
|
42 |
security_notifications: 1 |
|
43 |
# Maximum password age in days |
|
44 |
password_max_age: |
|
45 |
format: int |
|
46 |
default: 0 |
|
47 |
security_notifications: 1 |
|
48 |
# Maximum number of additional email addresses per user |
|
49 |
max_additional_emails: |
|
50 |
format: int |
|
51 |
default: 5 |
|
52 |
# Maximum lifetime of user sessions in minutes |
|
53 |
session_lifetime: |
|
54 |
format: int |
|
55 |
default: 0 |
|
56 |
security_notifications: 1 |
|
57 |
# User session timeout in minutes |
|
58 |
session_timeout: |
|
59 |
format: int |
|
60 |
default: 0 |
|
61 |
security_notifications: 1 |
|
62 |
attachment_max_size: |
|
63 |
format: int |
|
64 |
default: 5120 |
|
65 |
attachment_extensions_allowed: |
|
66 |
default: |
|
67 |
attachment_extensions_denied: |
|
68 |
default: |
|
69 |
issues_export_limit: |
|
70 |
format: int |
|
71 |
default: 500 |
|
72 |
activity_days_default: |
|
73 |
format: int |
|
74 |
default: 30 |
|
75 |
per_page_options: |
|
76 |
default: '25,50,100' |
|
77 |
search_results_per_page: |
|
78 |
default: 10 |
|
79 |
mail_from: |
|
80 |
default: redmine@example.net |
|
81 |
bcc_recipients: |
|
82 |
default: 1 |
|
83 |
plain_text_mail: |
|
84 |
default: 0 |
|
85 |
text_formatting: |
|
86 |
default: textile |
|
87 |
cache_formatted_text: |
|
88 |
default: 0 |
|
89 |
wiki_compression: |
|
90 |
default: "" |
|
91 |
default_language: |
|
92 |
default: en |
|
93 |
force_default_language_for_anonymous: |
|
94 |
default: 0 |
|
95 |
force_default_language_for_loggedin: |
|
96 |
default: 0 |
|
97 |
host_name: |
|
98 |
default: localhost:3000 |
|
99 |
protocol: |
|
100 |
default: http |
|
101 |
security_notifications: 1 |
|
102 |
feeds_limit: |
|
103 |
format: int |
|
104 |
default: 15 |
|
105 |
gantt_items_limit: |
|
106 |
format: int |
|
107 |
default: 500 |
|
108 |
# Maximum size of files that can be displayed |
|
109 |
# inline through the file viewer (in KB) |
|
110 |
file_max_size_displayed: |
|
111 |
format: int |
|
112 |
default: 512 |
|
113 |
diff_max_lines_displayed: |
|
114 |
format: int |
|
115 |
default: 1500 |
|
116 |
enabled_scm: |
|
117 |
serialized: true |
|
118 |
default: |
|
119 |
- Subversion |
|
120 |
- Darcs |
|
121 |
- Mercurial |
|
122 |
- Cvs |
|
123 |
- Bazaar |
|
124 |
- Git |
|
125 |
security_notifications: 1 |
|
126 |
autofetch_changesets: |
|
127 |
default: 1 |
|
128 |
sys_api_enabled: |
|
129 |
default: 0 |
|
130 |
security_notifications: 1 |
|
131 |
sys_api_key: |
|
132 |
default: '' |
|
133 |
security_notifications: 1 |
|
134 |
commit_cross_project_ref: |
|
135 |
default: 0 |
|
136 |
commit_ref_keywords: |
|
137 |
default: 'refs,references,IssueID' |
|
138 |
commit_update_keywords: |
|
139 |
serialized: true |
|
140 |
default: [] |
|
141 |
commit_logtime_enabled: |
|
142 |
default: 0 |
|
143 |
commit_logtime_activity_id: |
|
144 |
format: int |
|
145 |
default: 0 |
|
146 |
# autologin duration in days |
|
147 |
# 0 means autologin is disabled |
|
148 |
autologin: |
|
149 |
format: int |
|
150 |
default: 0 |
|
151 |
# date format |
|
152 |
date_format: |
|
153 |
default: '' |
|
154 |
time_format: |
|
155 |
default: '' |
|
156 |
user_format: |
|
157 |
default: :firstname_lastname |
|
158 |
format: symbol |
|
159 |
cross_project_issue_relations: |
|
160 |
default: 0 |
|
161 |
# Enables subtasks to be in other projects |
|
162 |
cross_project_subtasks: |
|
163 |
default: 'tree' |
|
164 |
parent_issue_dates: |
|
165 |
default: 'derived' |
|
166 |
parent_issue_priority: |
|
167 |
default: 'derived' |
|
168 |
parent_issue_done_ratio: |
|
169 |
default: 'derived' |
|
170 |
link_copied_issue: |
|
171 |
default: 'ask' |
|
172 |
issue_group_assignment: |
|
173 |
default: 0 |
|
174 |
default_issue_start_date_to_creation_date: |
|
175 |
default: 1 |
|
176 |
notified_events: |
|
177 |
serialized: true |
|
178 |
default: |
|
179 |
- issue_added |
|
180 |
- issue_updated |
|
181 |
mail_handler_body_delimiters: |
|
182 |
default: '' |
|
183 |
mail_handler_excluded_filenames: |
|
184 |
default: '' |
|
185 |
mail_handler_api_enabled: |
|
186 |
default: 0 |
|
187 |
security_notifications: 1 |
|
188 |
mail_handler_api_key: |
|
189 |
default: |
|
190 |
security_notifications: 1 |
|
191 |
issue_list_default_columns: |
|
192 |
serialized: true |
|
193 |
default: |
|
194 |
- tracker |
|
195 |
- status |
|
196 |
- priority |
|
197 |
- subject |
|
198 |
- assigned_to |
|
199 |
- updated_on |
|
200 |
issue_list_default_totals: |
|
201 |
serialized: true |
|
202 |
default: [] |
|
203 |
display_subprojects_issues: |
|
204 |
default: 1 |
|
205 |
issue_done_ratio: |
|
206 |
default: 'issue_field' |
|
207 |
default_projects_public: |
|
208 |
default: 1 |
|
209 |
default_projects_modules: |
|
210 |
serialized: true |
|
211 |
default: |
|
212 |
- issue_tracking |
|
213 |
- time_tracking |
|
214 |
- news |
|
215 |
- documents |
|
216 |
- files |
|
217 |
- wiki |
|
218 |
- repository |
|
219 |
- boards |
|
220 |
- calendar |
|
221 |
- gantt |
|
222 |
default_projects_tracker_ids: |
|
223 |
serialized: true |
|
224 |
default: |
|
225 |
# Role given to a non-admin user who creates a project |
|
226 |
new_project_user_role_id: |
|
227 |
format: int |
|
228 |
default: '' |
|
229 |
sequential_project_identifiers: |
|
230 |
default: 0 |
|
231 |
# encodings used to convert repository files content to UTF-8 |
|
232 |
# multiple values accepted, comma separated |
|
233 |
default_users_hide_mail: |
|
234 |
default: 1 |
|
235 |
repositories_encodings: |
|
236 |
default: '' |
|
237 |
# encoding used to convert commit logs to UTF-8 |
|
238 |
commit_logs_encoding: |
|
239 |
default: 'UTF-8' |
|
240 |
repository_log_display_limit: |
|
241 |
format: int |
|
242 |
default: 100 |
|
243 |
ui_theme: |
|
244 |
default: '' |
|
245 |
emails_footer: |
|
246 |
default: |- |
|
247 |
You have received this notification because you have either subscribed to it, or are involved in it. |
|
248 |
To change your notification preferences, please click here: http://hostname/my/account |
|
249 |
gravatar_enabled: |
|
250 |
default: 0 |
|
251 |
openid: |
|
252 |
default: 0 |
|
253 |
security_notifications: 1 |
|
254 |
gravatar_default: |
|
255 |
default: '' |
|
256 |
start_of_week: |
|
257 |
default: '' |
|
258 |
rest_api_enabled: |
|
259 |
default: 0 |
|
260 |
security_notifications: 1 |
|
261 |
jsonp_enabled: |
|
262 |
default: 0 |
|
263 |
security_notifications: 1 |
|
264 |
default_notification_option: |
|
265 |
default: 'only_my_events' |
|
266 |
emails_header: |
|
267 |
default: '' |
|
268 |
thumbnails_enabled: |
|
269 |
default: 0 |
|
270 |
thumbnails_size: |
|
271 |
format: int |
|
272 |
default: 100 |
|
273 |
non_working_week_days: |
|
274 |
serialized: true |
|
275 |
default: |
|
276 |
- '6' |
|
277 |
- '7' |
config/settings.yml.example | ||
---|---|---|
1 |
# Redmine - project management software |
|
2 |
# Copyright (C) 2006-2016 Jean-Philippe Lang |
|
3 |
# |
|
4 |
# This program is free software; you can redistribute it and/or |
|
5 |
# modify it under the terms of the GNU General Public License |
|
6 |
# as published by the Free Software Foundation; either version 2 |
|
7 |
# of the License, or (at your option) any later version. |
|
8 |
# |
|
9 |
# This program is distributed in the hope that it will be useful, |
|
10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
# GNU General Public License for more details. |
|
13 |
# |
|
14 |
# You should have received a copy of the GNU General Public License |
|
15 |
# along with this program; if not, write to the Free Software |
|
16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | ||
18 | ||
19 |
# DO NOT MODIFY THIS FILE !!! |
|
20 |
# Settings can be defined through the application in Admin -> Settings |
|
21 | ||
22 |
app_title: |
|
23 |
default: Redmine |
|
24 |
app_subtitle: |
|
25 |
default: Project management |
|
26 |
welcome_text: |
|
27 |
default: |
|
28 |
login_required: |
|
29 |
default: 0 |
|
30 |
security_notifications: 1 |
|
31 |
self_registration: |
|
32 |
default: '2' |
|
33 |
security_notifications: 1 |
|
34 |
lost_password: |
|
35 |
default: 1 |
|
36 |
security_notifications: 1 |
|
37 |
unsubscribe: |
|
38 |
default: 1 |
|
39 |
password_min_length: |
|
40 |
format: int |
|
41 |
default: 8 |
|
42 |
security_notifications: 1 |
|
43 |
# Maximum password age in days |
|
44 |
password_max_age: |
|
45 |
format: int |
|
46 |
default: 0 |
|
47 |
security_notifications: 1 |
|
48 |
# Maximum number of additional email addresses per user |
|
49 |
max_additional_emails: |
|
50 |
format: int |
|
51 |
default: 5 |
|
52 |
# Maximum lifetime of user sessions in minutes |
|
53 |
session_lifetime: |
|
54 |
format: int |
|
55 |
default: 0 |
|
56 |
security_notifications: 1 |
|
57 |
# User session timeout in minutes |
|
58 |
session_timeout: |
|
59 |
format: int |
|
60 |
default: 0 |
|
61 |
security_notifications: 1 |
|
62 |
attachment_max_size: |
|
63 |
format: int |
|
64 |
default: 5120 |
|
65 |
attachment_extensions_allowed: |
|
66 |
default: |
|
67 |
attachment_extensions_denied: |
|
68 |
default: |
|
69 |
issues_export_limit: |
|
70 |
format: int |
|
71 |
default: 500 |
|
72 |
activity_days_default: |
|
73 |
format: int |
|
74 |
default: 30 |
|
75 |
per_page_options: |
|
76 |
default: '25,50,100' |
|
77 |
search_results_per_page: |
|
78 |
default: 10 |
|
79 |
mail_from: |
|
80 |
default: redmine@example.net |
|
81 |
bcc_recipients: |
|
82 |
default: 1 |
|
83 |
plain_text_mail: |
|
84 |
default: 0 |
|
85 |
text_formatting: |
|
86 |
default: textile |
|
87 |
cache_formatted_text: |
|
88 |
default: 0 |
|
89 |
wiki_compression: |
|
90 |
default: "" |
|
91 |
default_language: |
|
92 |
default: en |
|
93 |
force_default_language_for_anonymous: |
|
94 |
default: 0 |
|
95 |
force_default_language_for_loggedin: |
|
96 |
default: 0 |
|
97 |
host_name: |
|
98 |
default: localhost:3000 |
|
99 |
protocol: |
|
100 |
default: http |
|
101 |
security_notifications: 1 |
|
102 |
feeds_limit: |
|
103 |
format: int |
|
104 |
default: 15 |
|
105 |
gantt_items_limit: |
|
106 |
format: int |
|
107 |
default: 500 |
|
108 |
# Maximum size of files that can be displayed |
|
109 |
# inline through the file viewer (in KB) |
|
110 |
file_max_size_displayed: |
|
111 |
format: int |
|
112 |
default: 512 |
|
113 |
diff_max_lines_displayed: |
|
114 |
format: int |
|
115 |
default: 1500 |
|
116 |
enabled_scm: |
|
117 |
serialized: true |
|
118 |
default: |
|
119 |
- Subversion |
|
120 |
- Darcs |
|
121 |
- Mercurial |
|
122 |
- Cvs |
|
123 |
- Bazaar |
|
124 |
- Git |
|
125 |
security_notifications: 1 |
|
126 |
autofetch_changesets: |
|
127 |
default: 1 |
|
128 |
sys_api_enabled: |
|
129 |
default: 0 |
|
130 |
security_notifications: 1 |
|
131 |
sys_api_key: |
|
132 |
default: '' |
|
133 |
security_notifications: 1 |
|
134 |
commit_cross_project_ref: |
|
135 |
default: 0 |
|
136 |
commit_ref_keywords: |
|
137 |
default: 'refs,references,IssueID' |
|
138 |
commit_update_keywords: |
|
139 |
serialized: true |
|
140 |
default: [] |
|
141 |
commit_logtime_enabled: |
|
142 |
default: 0 |
|
143 |
commit_logtime_activity_id: |
|
144 |
format: int |
|
145 |
default: 0 |
|
146 |
# autologin duration in days |
|
147 |
# 0 means autologin is disabled |
|
148 |
autologin: |
|
149 |
format: int |
|
150 |
default: 0 |
|
151 |
# date format |
|
152 |
date_format: |
|
153 |
default: '' |
|
154 |
time_format: |
|
155 |
default: '' |
|
156 |
user_format: |
|
157 |
default: :firstname_lastname |
|
158 |
format: symbol |
|
159 |
cross_project_issue_relations: |
|
160 |
default: 0 |
|
161 |
# Enables subtasks to be in other projects |
|
162 |
cross_project_subtasks: |
|
163 |
default: 'tree' |
|
164 |
parent_issue_dates: |
|
165 |
default: 'derived' |
|
166 |
parent_issue_priority: |
|
167 |
default: 'derived' |
|
168 |
parent_issue_done_ratio: |
|
169 |
default: 'derived' |
|
170 |
link_copied_issue: |
|
171 |
default: 'ask' |
|
172 |
issue_group_assignment: |
|
173 |
default: 0 |
|
174 |
default_issue_start_date_to_creation_date: |
|
175 |
default: 1 |
|
176 |
notified_events: |
|
177 |
serialized: true |
|
178 |
default: |
|
179 |
- issue_added |
|
180 |
- issue_updated |
|
181 |
mail_handler_body_delimiters: |
|
182 |
default: '' |
|
183 |
mail_handler_excluded_filenames: |
|
184 |
default: '' |
|
185 |
mail_handler_api_enabled: |
|
186 |
default: 0 |
|
187 |
security_notifications: 1 |
|
188 |
mail_handler_api_key: |
|
189 |
default: |
|
190 |
security_notifications: 1 |
|
191 |
issue_list_default_columns: |
|
192 |
serialized: true |
|
193 |
default: |
|
194 |
- tracker |
|
195 |
- status |
|
196 |
- priority |
|
197 |
- subject |
|
198 |
- assigned_to |
|
199 |
- updated_on |
|
200 |
issue_list_default_totals: |
|
201 |
serialized: true |
|
202 |
default: [] |
|
203 |
display_subprojects_issues: |
|
204 |
default: 1 |
|
205 |
issue_done_ratio: |
|
206 |
default: 'issue_field' |
|
207 |
default_projects_public: |
|
208 |
default: 1 |
|
209 |
default_projects_modules: |
|
210 |
serialized: true |
|
211 |
default: |
|
212 |
- issue_tracking |
|
213 |
- time_tracking |
|
214 |
- news |
|
215 |
- documents |
|
216 |
- files |
|
217 |
- wiki |
|
218 |
- repository |
|
219 |
- boards |
|
220 |
- calendar |
|
221 |
- gantt |
|
222 |
default_projects_tracker_ids: |
|
223 |
serialized: true |
|
224 |
default: |
|
225 |
# Role given to a non-admin user who creates a project |
|
226 |
new_project_user_role_id: |
|
227 |
format: int |
|
228 |
default: '' |
|
229 |
sequential_project_identifiers: |
|
230 |
default: 0 |
|
231 |
# encodings used to convert repository files content to UTF-8 |
|
232 |
# multiple values accepted, comma separated |
|
233 |
default_users_hide_mail: |
|
234 |
default: 1 |
|
235 |
repositories_encodings: |
|
236 |
default: '' |
|
237 |
# encoding used to convert commit logs to UTF-8 |
|
238 |
commit_logs_encoding: |
|
239 |
default: 'UTF-8' |
|
240 |
repository_log_display_limit: |
|
241 |
format: int |
|
242 |
default: 100 |
|
243 |
ui_theme: |
|
244 |
default: '' |
|
245 |
emails_footer: |
|
246 |
default: |- |
|
247 |
You have received this notification because you have either subscribed to it, or are involved in it. |
|
248 |
To change your notification preferences, please click here: http://hostname/my/account |
|
249 |
gravatar_enabled: |
|
250 |
default: 0 |
|
251 |
openid: |
|
252 |
default: 0 |
|
253 |
security_notifications: 1 |
|
254 |
gravatar_default: |
|
255 |
default: '' |
|
256 |
start_of_week: |
|
257 |
default: '' |
|
258 |
rest_api_enabled: |
|
259 |
default: 0 |
|
260 |
security_notifications: 1 |
|
261 |
jsonp_enabled: |
|
262 |
default: 0 |
|
263 |
security_notifications: 1 |
|
264 |
default_notification_option: |
|
265 |
default: 'only_my_events' |
|
266 |
emails_header: |
|
267 |
default: '' |
|
268 |
thumbnails_enabled: |
|
269 |
default: 0 |
|
270 |
thumbnails_size: |
|
271 |
format: int |
|
272 |
default: 100 |
|
273 |
non_working_week_days: |
|
274 |
serialized: true |
|
275 |
default: |
|
276 |
- '6' |
|
277 |
- '7' |