@@ -51,7 +51,7 @@ def linked_extended_metadata_form_field(attribute, value, element_name, element_
5151
5252 attribute . linked_extended_metadata_type . extended_metadata_attributes . each do |attr |
5353 attr_element_name = "#{ element_name } [#{ attr . title } ]"
54- html += '<div class="form-group"><label>' +attr . label +'</label>'
54+ html += '<div class="form-group"><label>' +h ( attr . label ) +'</label>'
5555 html += required_span if attr . required?
5656 v = value ? value [ attr . title ] : nil
5757 if attr . linked_extended_metadata?
@@ -104,16 +104,16 @@ def authorised_samples(projects = nil)
104104 end
105105
106106 def sample_attribute_display_title ( attribute )
107- title = attribute . title
107+ title = h ( attribute . title )
108108 if ( unit = attribute . unit ) && !unit . dimensionless?
109- title += " ( #{ unit } )"
109+ title += h ( " ( #{ unit } )" )
110110 end
111111 unless attribute . pid . blank?
112112 title += content_tag ( :small , 'data-tooltip' => attribute . pid ) do
113- " [ " +attribute . short_pid + " ]"
114- end . html_safe
113+ ( " [ " +h ( attribute . short_pid ) + " ]" ) . html_safe
114+ end
115115 end
116- title . html_safe
116+ title
117117 end
118118
119119 def display_attribute ( resource , attribute , options = { } )
@@ -194,12 +194,12 @@ def linked_extended_metadata_attribute_display(value, attribute)
194194 html += '<li>'
195195 if attr . linked_extended_metadata? || attr . linked_extended_metadata_multi?
196196 html += content_tag ( :span , class : 'linked_extended_metdata_display' ) do
197- folding_panel ( attr . label , true , id :attr . title ) do
197+ folding_panel ( h ( attr . label ) , true , id :attr . title ) do
198198 display_attribute_value ( v , attr )
199199 end
200200 end
201201 else
202- html += '<label>' +attr . title +'</label>' +' : '
202+ html += '<label>' +h ( attr . title ) +'</label>' +' : '
203203 html += display_attribute_value ( v , attr )
204204 end
205205 html += '</li>'
0 commit comments