diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 10dcb3b8..542d3086 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -107,7 +107,7 @@ module ApplicationHelper
text = options.delete(:text) || format_revision(revision)
rev = revision.respond_to?(:identifier) ? revision.identifier : revision
- link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => rev},
+ link_to(h(text), {:controller => 'repositories', :action => 'revision', :id => project, :rev => rev},
:title => l(:label_revision_id, format_revision(revision)))
end
@@ -410,7 +410,7 @@ module ApplicationHelper
def html_title(*args)
if args.empty?
title = []
- title << @project.name if @project
+ title << h(@project.name) if @project
title += @html_title if @html_title
title << Setting.app_title
title.select {|t| !t.blank? }.join(' - ')
@@ -561,7 +561,7 @@ module ApplicationHelper
wiki_page_id = page.present? ? Wiki.titleize(page) : nil
url_for(:only_path => only_path, :controller => 'wiki', :action => 'show', :project_id => link_project, :id => wiki_page_id, :anchor => anchor)
end
- link_to((title || page), url, :class => ('wiki-page' + (wiki_page ? '' : ' new')))
+ link_to(h(title || page), url, :class => ('wiki-page' + (wiki_page ? '' : ' new')))
else
# project or wiki doesn't exist
all
@@ -615,7 +615,7 @@ module ApplicationHelper
if prefix.nil? && sep == 'r'
# project.changesets.visible raises an SQL error because of a double join on repositories
if project && project.repository && (changeset = Changeset.visible.find_by_repository_id_and_revision(project.repository.id, identifier))
- link = link_to("#{project_prefix}r#{identifier}", {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => changeset.revision},
+ link = link_to(h("#{project_prefix}r#{identifier}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => changeset.revision},
:class => 'changeset',
:title => truncate_single_line(changeset.comments, :length => 100))
end
@@ -665,7 +665,7 @@ module ApplicationHelper
if project && project.repository && (changeset = Changeset.visible.find(:first, :conditions => ["repository_id = ? AND scmid LIKE ?", project.repository.id, "#{name}%"]))
link = link_to h("#{project_prefix}#{name}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => changeset.identifier},
:class => 'changeset',
- :title => truncate_single_line(changeset.comments, :length => 100)
+ :title => truncate_single_line(h(changeset.comments), :length => 100)
end
when 'source', 'export'
if project && project.repository && User.current.allowed_to?(:browse_repository, project)
@@ -831,7 +831,7 @@ module ApplicationHelper
options[:class] << ' disabled'
url = '#'
end
- link_to name, url, options
+ link_to h(name), url, options
end
def calendar_for(field_id)
diff --git a/app/helpers/calendars_helper.rb b/app/helpers/calendars_helper.rb
index b2de58f7..b8f5fcb3 100644
--- a/app/helpers/calendars_helper.rb
+++ b/app/helpers/calendars_helper.rb
@@ -45,6 +45,6 @@ module CalendarsHelper
end
def link_to_month(link_name, year, month, options={})
- link_to_content_update(link_name, params.merge(:year => year, :month => month))
+ link_to_content_update(h(link_name), params.merge(:year => year, :month => month))
end
end
diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb
index 6fb59ee4..ba3328bb 100644
--- a/app/helpers/custom_fields_helper.rb
+++ b/app/helpers/custom_fields_helper.rb
@@ -53,7 +53,7 @@ module CustomFieldsHelper
# Return custom field label tag
def custom_field_label_tag(name, custom_value)
- content_tag "label", custom_value.custom_field.name +
+ content_tag "label", h(custom_value.custom_field.name) +
(custom_value.custom_field.is_required? ? " *" : ""),
:for => "#{name}_custom_field_values_#{custom_value.custom_field.id}",
:class => (custom_value.errors.empty? ? nil : "error" )
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 84b5a63b..4063d763 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -44,11 +44,11 @@ module IssuesHelper
link_to_issue(issue) + "
" +
"#{@cached_label_project}: #{link_to_project(issue.project)}
" +
- "#{@cached_label_status}: #{issue.status.name}
" +
+ "#{@cached_label_status}: #{h(issue.status.name)}
" +
"#{@cached_label_start_date}: #{format_date(issue.start_date)}
" +
"#{@cached_label_due_date}: #{format_date(issue.due_date)}
" +
- "#{@cached_label_assigned_to}: #{issue.assigned_to}
" +
- "#{@cached_label_priority}: #{issue.priority.name}"
+ "#{@cached_label_assigned_to}: #{h(issue.assigned_to)}
" +
+ "#{@cached_label_priority}: #{h(issue.priority.name)}"
end
def render_issue_subject_with_tree(issue)
@@ -114,7 +114,7 @@ module IssuesHelper
# links to #index on issues/show
url_params = controller_name == 'issues' ? {:controller => 'issues', :action => 'index', :project_id => @project} : params
- content_tag('h3', title) +
+ content_tag('h3', h(title)) +
queries.collect {|query|
link_to(h(query.name), url_params.merge(:query_id => query))
}.join('
')
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index b4fd07c3..d468be9a 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -20,7 +20,7 @@ module QueriesHelper
def column_header(column)
column.sortable ? sort_header_tag(column.name.to_s, :caption => column.caption,
:default_order => column.default_order) :
- content_tag('th', column.caption)
+ content_tag('th', h(column.caption))
end
def column_content(column, issue)
@@ -41,7 +41,7 @@ module QueriesHelper
if column.name == :done_ratio
progress_bar(value, :width => '80px')
else
- value.to_s
+ h(value.to_s)
end
when 'User'
link_to_user value
diff --git a/app/helpers/reports_helper.rb b/app/helpers/reports_helper.rb
index 6b965fb4..adf66589 100644
--- a/app/helpers/reports_helper.rb
+++ b/app/helpers/reports_helper.rb
@@ -27,6 +27,6 @@ module ReportsHelper
def aggregate_link(data, criteria, *args)
a = aggregate data, criteria
- a > 0 ? link_to(a, *args) : '-'
+ a > 0 ? link_to(h(a), *args) : '-'
end
end
diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb
index b81778b0..556da589 100644
--- a/app/helpers/repositories_helper.rb
+++ b/app/helpers/repositories_helper.rb
@@ -83,7 +83,7 @@ module RepositoriesHelper
if s = tree[file][:s]
style << ' folder'
path_param = to_path_param(@repository.relative_path(file))
- text = link_to(text, :controller => 'repositories',
+ text = link_to(h(text), :controller => 'repositories',
:action => 'show',
:id => @project,
:path => path_param,
@@ -93,18 +93,18 @@ module RepositoriesHelper
elsif c = tree[file][:c]
style << " change-#{c.action}"
path_param = to_path_param(@repository.relative_path(c.path))
- text = link_to(text, :controller => 'repositories',
+ text = link_to(h(text), :controller => 'repositories',
:action => 'entry',
:id => @project,
:path => path_param,
:rev => @changeset.identifier) unless c.action == 'D'
- text << " - #{c.revision}" unless c.revision.blank?
+ text << " - #{h(c.revision)}" unless c.revision.blank?
text << ' (' + link_to('diff', :controller => 'repositories',
:action => 'diff',
:id => @project,
:path => path_param,
:rev => @changeset.identifier) + ') ' if c.action == 'M'
- text << ' ' + content_tag('span', c.from_path, :class => 'copied-from') unless c.from_path.blank?
+ text << ' ' + content_tag('span', h(c.from_path), :class => 'copied-from') unless c.from_path.blank?
output << "