New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when rendering non-ASCII ReadMe files #517

Merged
merged 1 commit into from Oct 1, 2015

Conversation

Projects
None yet
2 participants
@stanclai

stanclai commented Sep 29, 2015

Avoid crash on ReadMe files containing non-ASCII symbols

Without such workaround this module constantly caused Server Error 500 in repository view with the following log dump, if the repo contained ReadMe file in UTF-8 codepage:

  Rendered plugins/redmine_git_hosting/app/views/repositories/show.html.erb within layouts/base (191.4ms)
Completed 500 Internal Server Error in 303ms (ActiveRecord: 30.8ms)                            

ActionView::Template::Error ("\xE2" from ASCII-8BIT to UTF-8):
    47:                        :id => @project, :page => nil, :key => User.current.rss_key})) %>
    48:    <% end %>
    49:
    50:    <%= call_hook(:view_repositories_show_bottom) %>
    51:
    52:    <% other_formats_links do |f| %>
    53:     <%= f.link_to 'Atom',
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:158:in `call_hook'
  app/controllers/repositories_controller.rb:125:in `show'
BUGFIX: non-ASCII ReadMe error
Avoid crash on ReadMe files containing non-ASCII symbols

Without such workaround this module constantly caused Server Error 500 in repository view with the following log dump, if the repo contained ReadMe file in UTF-8 codepage:

  Rendered plugins/redmine_git_hosting/app/views/repositories/show.html.erb within layouts/base (191.4ms)
Completed 500 Internal Server Error in 303ms (ActiveRecord: 30.8ms)                            

ActionView::Template::Error ("\xE2" from ASCII-8BIT to UTF-8):
    47:                        :id => @project, :page => nil, :key => User.current.rss_key})) %>
    48:    <% end %>
    49:
    50:    <%= call_hook(:view_repositories_show_bottom) %>
    51:
    52:    <% other_formats_links do |f| %>
    53:     <%= f.link_to 'Atom',
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:158:in `call_hook'
  app/controllers/repositories_controller.rb:125:in `show'

n-rodriguez added a commit that referenced this pull request Oct 1, 2015

@n-rodriguez n-rodriguez merged commit a835d5d into jbox-web:devel Oct 1, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@n-rodriguez

This comment has been minimized.

Show comment
Hide comment
@n-rodriguez

n-rodriguez Oct 1, 2015

Member

Thank you!

Member

n-rodriguez commented Oct 1, 2015

Thank you!

@n-rodriguez n-rodriguez self-assigned this Oct 1, 2015

@n-rodriguez n-rodriguez added the bugfix label Oct 1, 2015

@n-rodriguez n-rodriguez added this to the 1.1.4 milestone Oct 1, 2015

@n-rodriguez n-rodriguez changed the title from BUGFIX: non-ASCII ReadMe error to Fix error when rendering non-ASCII ReadMe files Oct 1, 2015

@stanclai

This comment has been minimized.

Show comment
Hide comment
@stanclai

stanclai Oct 5, 2015

No problem :)

stanclai commented Oct 5, 2015

No problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment