Skip to content

Commit

Permalink
Merge pull request #265 from TrackIF/escape-experiment-names
Browse files Browse the repository at this point in the history
Experiments with single-quotes break "Use This" functionality
  • Loading branch information
andrew committed Sep 16, 2014
2 parents 30ca3a1 + 9d97105 commit f4c0a9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/split/dashboard/helpers.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module Split
module DashboardHelpers
def h(text)
Rack::Utils.escape_html(text)
end

def url(*path_parts)
[ path_prefix, path_parts ].join("/").squeeze('/')
end
Expand Down
2 changes: 1 addition & 1 deletion lib/split/dashboard/views/_experiment.erb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<% end %>
<% else %>
<form action="<%= url experiment.name %>" method='post' onclick="return confirmWinner()">
<input type='hidden' name='alternative' value='<%= alternative.name %>'>
<input type='hidden' name='alternative' value='<%= h alternative.name %>'>
<input type="submit" value="Use this" class="green">
</form>
<% end %>
Expand Down

0 comments on commit f4c0a9d

Please sign in to comment.