Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixes exception when log is empty #97

Closed
wants to merge 2 commits into from

3 participants

@tecnobrat

This fixes an exception I would receive if there was no log yet, which usually happens if the project is not built yet.

Also added a test.

@gudata

thanks for fixing this.

@SeanMarcia
Collaborator

Thanks for this fix! Foomip fixed this another way, he used

CGI.escapeHTML(log.strip)

Which removed the exception. Sorry it took so long for someone to reply. I was just recently given access to the project so you can expect more timely replies to anything.

@SeanMarcia SeanMarcia was assigned
@SeanMarcia
Collaborator

My bad. You were completely correct :) I merged in this pull request. Thanks so much!

@SeanMarcia SeanMarcia closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 11, 2012
  1. @tecnobrat
Commits on Mar 27, 2012
  1. @tecnobrat
This page is out of date. Refresh to see the latest.
View
1  app/helpers/application_helper.rb
@@ -76,6 +76,7 @@ def display_builder_state(state)
end
def format_changeset_log(log)
+ log = "" if log.blank?
h(log.strip)
end
View
5 test/unit/application_helper_test.rb
@@ -35,6 +35,11 @@ class ApplicationHelperTest < ActionView::TestCase
end
context "#format_changeset_log" do
+ test "should render nothing if log is nil" do
+ @helper.extend(ERB::Util)
+ assert_equal "", @helper.format_changeset_log(nil)
+ end
+
test "should strip html tags" do
@helper.extend(ERB::Util)
assert_equal "&lt;hr /&gt;some changeset&lt;script&gt;alert('bad')&lt;/script&gt;",
Something went wrong with that request. Please try again.